PerFieldAnalyzerWrapper is your friend, assuming that you have separate
fields, some tokenized and some not. If you *don't* have separate
fields, then we need more details of what you hope to accomplish...

something like

(+tokenized:value1 +tokenized:vaue2) (+untokenized:value3 +
untokenized:value4)

should do the trick, where you've constructed a PerFieldAnalyzerWrapper
with a tokenizing analyzer for field "tokenized" and a non-tokenizing
analyzer
for field "untokenized".

Best
Erick

On Mon, Mar 9, 2009 at 11:01 AM, rokham <somebodyik...@gmail.com> wrote:

>
> Hi,
>
> I've been trying to find a way which allows executing a query that contains
> both Tokenized and Untokenized fields on Lucene's index, without having to
> parse the query. I've been able to execute a query which only uses
> Tokenized
> fields as follows:
>
>   QueryParser queryParser = new QueryParser( DEFAULT_FIELD, analyzer);
>   Query query = queryParser.parse(queryString);
>   Hits hits = indexSearcher.search(query);
>
> This works fine for Tokenized fields but I'm not sure how to execute a
> query
> ("queryString") which contains both tokenized and untokenized fields.
>
> Any suggestion is very much appreciated.
>
> Rokham
> --
> View this message in context:
> http://www.nabble.com/How-to-search-both-Tokenized-and-Untokenized-fields-tp22413438p22413438.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
>

Reply via email to