You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by WATHELET Thomas <TW...@europarl.eu.int> on 2006/03/22 15:18:40 UTC

Query question

I use Lucene 1.9.1

How to parse an unc path like \\tom\share\5\tom.doc
<file:///\\tom\share\5\tom.doc>  in a query to search in the index key
field?

String key="\\tom\share\5\tom.doc <file:///\\tom\share\5\tom.doc> ";

Ex: Hits hits = multisearch.search(new TermQuery(new Term("key",
QueryParser.escape(key))));

I ask this question because this key exist into the index but I can't
find it


Re: Query question

Posted by Chris Hostetter <ho...@fucit.org>.
: Use "Keyword" (untokenized) field to index your paths.
: Consider using PerFieldAnalyzerWrapper to specify KeywordAnalyzer for your path field.
: Use the force, Luke - http://www.getopt.org/luke/ , to ensure your paths are indexed correctly.

you also don't wnat to use QueryParser.escape when you build the term
query explicitly -- that's only needed if you are passing the string to
QueryParser...

: Ex: Hits hits = multisearch.search(new TermQuery(new Term("key",
: QueryParser.escape(key))));



-Hoss


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


Re: Query question

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hi Thomas,

Use "Keyword" (untokenized) field to index your paths.
Consider using PerFieldAnalyzerWrapper to specify KeywordAnalyzer for your path field.
Use the force, Luke - http://www.getopt.org/luke/ , to ensure your paths are indexed correctly.

Otis

----- Original Message ----
From: WATHELET Thomas <TW...@europarl.eu.int>
To: java-user@lucene.apache.org
Sent: Wednesday, March 22, 2006 9:18:40 AM
Subject: Query question

I use Lucene 1.9.1

How to parse an unc path like \\tom\share\5\tom.doc
<file:///\\tom\share\5\tom.doc>  in a query to search in the index key
field?

String key="\\tom\share\5\tom.doc <file:///\\tom\share\5\tom.doc> ";

Ex: Hits hits = multisearch.search(new TermQuery(new Term("key",
QueryParser.escape(key))));

I ask this question because this key exist into the index but I can't
find it





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