A Search Engine based on Lucene. Apache Lucene is a free and open-source search engine software library, originally written in Java. Lucene is widely used as a standard foundation for production search applications
This Project uses:
- Oracle JDK 17
- Lucene 9.8.1
- Installation
- Springboot
- Planning to add vector db (Pinecone)
- Semantic Search
The easiest way to use Lucene in your project is to import it using Maven. You need to at least import lucene-core (just pasting the following to your pom.xml's dependencies).
org.apache.lucene lucene-core 8.10.1You may also need Lucene-analyzers-common and lucene-queryparser.
org.apache.lucene lucene-analyzers-common 9.8.1 org.apache.lucene lucene-queryparser 8.10.1https://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Overview
- BooleanQuery
- ConstantScoreQuery
- CustomScoreQuery
- DisjunctionMaxQuery
- FilteredQuery
- MatchAllDocsQuery
- MultiPhraseQuery
- MultiTermQuery
- PhraseQuery
- RangeQuery
- SpanQuery
- TermQuery
- ValueSourceQuery
BooleanQuery can be created using other other type of query and BooleanQuery itself
You can view this in details here
https://riptutorial.com/lucene/example/19933/booleanquery
String str = "foo bar";
String id = "123456";
BooleanQuery bq = new BooleanQuery();
Query query = qp.parse(str);
bq.add(query, BooleanClause.Occur.MUST);
bq.add(new TermQuery(new Term("id", id), BooleanClause.Occur.MUST_NOT);
Using spring-boot, java 17, maven, react