lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: lucene query parser for double-worded term query
Date Wed, 25 Jun 2008 00:26:18 GMT
You can backslash escape spaces, so these should both work:
tags:San\ Francisco
tags:"San\ Francisco"

-Yonik

On Tue, Jun 24, 2008 at 8:14 PM, Chris Lu <chris.lu@gmail.com> wrote:
> I have a tags field. And each tag can have multiple words, like "San
> Francisco". Each tag is analyzed into Keyword field like this
>  new Field("tags", "San Francisco",Field.Store.YES,
> Field.Index.UN_TOKENIZED)
>
> It should be searchable if using TermQuery directly, like
>  new TermQuery(new Term("tags", "San Francisco"))
>
> But how to achieve this via Lucene Query Parser? If using
>  tags:"San Francisco"
> It's considered a phrase, and turned into term search of tags:San and
> tags:Francisco, which will not return results.
>
> Thanks for any advice!
>
> --
> Chris Lu
> -------------------------
> Instant Scalable Full-Text Search On Any Database/Application
> site: http://www.dbsight.net
> demo: http://search.dbsight.com
> Lucene Database Search in 3 minutes:
> http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
> DBSight customer, a shopping comparison site, (anonymous per request) got
> 2.6 Million Euro funding!
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message