Skip to content
Advertisement

Tag: lucene

Why is Lucene sometimes not matching InChIKeys?

I have indexed my database using Hibernate Search. I use a custom analyzer, both for indexing and for querying. I have a field called inchikey that should not get tokenized. Example values are: BBBAWACESCACAP-UHFFFAOYSA-N KEZLDSPIRVZOKZ-AUWJEWJLSA-N When I look into my index with Luke I can confirm that they are not tokenized, as required. However, when I try to search them

How to do a Multi field – Phrase search in Lucene?

Title asks it all… I want to do a multi field – phrase search in Lucene.. How to do it ? for example : I have fields as String s[] = {“title”,”author”,”content”}; I want to search harry potter across all fields.. How do I do it ? Can someone please provide an example snippet ? Answer Use MultiFieldQueryParser, its a

Advertisement