Searching for multi keywords in multi fields using LUCENE library -


I want to search keyword2 in keyword1 and 2 in field 1. Actually this code works but it gives me the result of field 1 and in field 2 one of them contains keywords:

  Standard Analyst Analyzer = New Standard Analyzer (version LUCENE_46 , StopWordsSet); String [] field = {"field 1", "field2"}; Float float 10 = new float (10); Float float 5 = new float (5); Maps & lt; String, float & gt; Boost = new hashmop & lt; String, float & gt; (); Boost.put ("nom", float10); Boost.put ("email", float 10); Multifield skitter mfqp = new multifield screen (version LUCENE_46, field, analyzer, boost); Mfqp.setAllowLeadingWildcard (right); Query UserNet = mfqp.parse ("* keyword *");  

Your question seems to be searching for documents that contain 'keyword' < Em> both field 1 and field 2, if this is correct, then the following help may be found. Note that if the default operator or order is required, then those signals are kept in mind.

  query usernames = mfqp.parse ("+ Field 1: * keyword * + field2: * keyword *")  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -