lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Uwe Schindler <>
Subject Re: Forcing lucene to use specific field when processing parsed query
Date Sat, 06 Jul 2013 14:35:15 GMT

You can only do this manually with instanceof checks and walking through BooleanClauses.

The better way to fix your problem would be to change your query parser, e.g. by overriding
getFieldQuery and other protected methods to enforce a specific field while parsing the query


Puneet Pawaia <> schrieb:
>Hi all,
>I am using Lucene.Net 3.0.3 and need to search in a specific field
>(ignoring any fields specified in the query). I am given a parsed
>Query so I am unable to generate a parsed query with my required field.
>Is there any functionality in Lucene that allows me to loop through the
>terms of the query and change the field ? The given query would be a
>complex query where there would be spans, clauses etc.
>Or perhaps there is some way of forcing Lucene to ignore the fields
>in the parsed query and used a specified field only.
>Any help would be most appreciated.
>Puneet Pawaia

Uwe Schindler
H.-H.-Meier-Allee 63, 28213 Bremen
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message