lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <cdor...@gmail.com>
Subject Re: Space in fieldname
Date Wed, 24 Nov 2010 11:32:18 GMT
For fastest response better send this kind of questions to
java-user@lucene.apache.org

You should be able to escape the space by adding '\' just before the space,
as in "machine\\ supplier:dell"

Doron

On Wed, Nov 24, 2010 at 12:31 PM, shane <smills@web.de> wrote:

>
> Hi there,
> searched this a while, but couldn't find satisfying results.
>
> My Projekt requires the fieldname to be able to have space characters in
> them, but as a matter of fact the term does not parse as wanted for search.
> Following my example.
>
> String searchTerm = +machine supplier:(dell OR medion) AND +HD:(200 OR 500)
> QueryParser parser = new QueryParser(Version.LUCENE_30, "ID", new
> KeywordAnalyzer());
> Query q = parser.parse(searchTerm);
>
> System.out.println("query : " + q);
>
> this results in th following output:
>
> query : +ID:machine +(supplier:dell supplier:medion) +(HD:200 HD:400)
>
> which in fact is wrong. the parser takes the first part of the fieldname
> "machine supplier" and puts the default fieldname infront of it.
>
> The customer needs the software to support space characters in fieldnames.
> Is there a way to tell the parser that this fieldname belongs together?
> Am I doing anything wrong?
>
> If anybody knows please let me know, thanks.
> shane
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Space-in-fieldname-tp1959883p1959883.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message