Use the “match all docs” query in a delete by query command: <delete><query>*:*</query></delete>
Tag Archives: Apache
Features Apache Lucene
Ranked Searching
Flexible Queries
Field-specific Queries
Sorting
Apache Lucene
Apache Lucene is a high-performance, fullfeatured text search engine library written entirely in Java
Apache Lucene is a free/open source information retrieval software library, originally created in Java by Doug Cutting. It is supported by the Apache Software Foundation and is released under the Apache Software License.
Lucene has been ported to other programming languages including PHP.
In Lucene, everything is a Document. A Lucene Document need notrefer to an actual file on a disk, it could also resemble a row in a
relational database.
Each developer is responsible for turning their own data sets intoLucene Documents. Lucene comes with a number of 3rd party
contributions, including examples for parsing structured data files suchas XML documents and Word files.
Command to start apache solr
Run the below given command
java -jar start.jar
This can be used for restarting Apache solr as well .
How to get data from apache solr – PHP
<?php
$output = file_get_contents(‘http://localhost:8983/solr/select?q=video&wt=php’);
eval(“$resultArray = ” . $output . “;”);
echo “<pre>”;print_r($resultArray);
?>
Delete data from apache solr
java -Ddata=args -Dcommit=no -jar post.jar “<delete><id>SP2514N</id></delete>”
Add data to apache solr
You can add data using the below given command
java -jar post.jar data.xml
Make sure that you have changed the directory where post.jar and xml files are available from the shell.
Apache Thrift
Apache solr
Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Apache Tomcat. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language.
Solr’s powerful external configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive plugin architecture when more advanced customization is required.
Apache Lucene and Apache Solr are both produced by the same ASF development team since the project merge in 2010. It is common to refer to the technology or products as Lucene/Solr or Solr/Lucene
Set the JAVA_HOME Variable in Windows
2) Right-click the My Computer icon on your desktop and select Properties.ThenClick the Advanced tab.
3) Click the Environment Variables button.Under System Variables, click New and Enter the variable name as JAVA_HOME.
4)Enter the variable value as the installation path for the Java Development Kit. If path name includes space it , replace it with ~
5)Click OK and Click Apply Changes.
6)Restart Windows.