I was writing an indexer interface and designed a method:
List<MyDocument> search(String query, int start, int end);
This method just like jdbc
search method: pass an sql
string and return.
But when I tried to use lucene to implement, i didn't find a way to parse query string into an Query Object.
I know QueryParser and MultiFieldQueryParser but they need pre-preparedly specify the fields to be searched. In my interface, which fields will be searched doesn't pre-know.
For example:
(title: help) AND (author: me) AND (content: plz)
Field title
, author
and content
is pre-unknown. How to build a Query for these pre-unknown fields searching in lucene?
Is there any way can help me?