Diff FieldType's encode diff values into terms in diff ways.  at query 
time the FieldTypes need to be consulted to know how to build the 
resulting query object.

Solr's query parsers are "schema aware" and delegate to the appropriate 
FieldType to handle any index term encoding needed -- but the lower level 
lucene QueryParser that you ar using does not...

:     org.apache.lucene.search.Query query = parser.parse(solrQueryString);
: 
: where parser is org.apache.lucene.queryparser.classic.QueryParser and then
: the following is used to get the document IDs:

...for anything except trivial StrField instances, that's not going to 
work -- not for any Trie based fields, or any TextFields (unless you go 
get the Analyzer from the schema) or any non trivial FieldTypes.

: The code worked perfectly in Solr 4.5. Now, in Solr 5.5.4, it works only if
: the query does not contain a date range query. For example, solrQueryString:

I'm not sure how that would have worked in Solr 4.5, ... unless 
perhaps your definition of a "date" field was different in the schema's 
you used in 4.5, and did not involve a Trie based date field  (the very 
old legacy date format ields used a simple String based encoding that 
might have worked)

The correct way for a plugin to do the sort of thing you are trying to do 
would be to use an instance of SolrQueryParser -- see for example the code 
in LuceneQParser and how it uses SolrQueryParser ... you'll most likeley 
just want to use LuceneQParser directly in your plugin to simplify things.



-Hoss
http://www.lucidworks.com/

Reply via email to