tags:

views:

30

answers:

1

I need my query parser to only read fields that are "text".
for example, lets say my query is: text:"this fox" OR title:"brown dog" for highlighting purposes, i need the parser/searcher to only search using the text:"this fox" part. in 2.4 this worked fine, but since upgrading to 2.9.3, something has changed.

example code:

IndexSearcher is = new IndexSearcher(fsDir);
    QueryParser qp = new QueryParser("text", new StandardAnalyzer(nostop));
  qp.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
Query queryDiv;
    try {
      query = is.rewrite(queryParser.parse(query_str)); 
    }

    catch (ParseException e) {
      pw.print("error: Incorrect query format");
      pw.close();
      return; 
    }
Hits hits = is.search(queryDiv, sort);

    QueryScorer scorer = new QueryScorer(query, "text");

for some reason, unknown to me, lucene 2.9.3 is now showing no results when in 2.4 it did, as it ignored the fields the document didnt have, not to mention that there is an OR condition in there.

any ideas?

A: 

please disregard this. there was a flaw in my logic that i was applying to the back end. thanks for looking

recursive9