lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Lucene
Date Mon, 12 Oct 2009 11:07:50 GMT
You are storing this field without analysis, correctly as you want
exact matches only, but using StandardAnalyzer at query time.  Use
PerFieldAnalyzerWrapper, specifying KeywordAnalyzer for this field.
Using MultiFieldQueryParser may not make much sense here.


--
Ian.



On Mon, Oct 12, 2009 at 11:55 AM, nja <seethalrd@gmail.com> wrote:
>
> Hi ,
>         I am using StandardAnalyzer for indexing as well as searching the
> indexes.But my search doesn't work correctly with special characters.I am
> storing some special characters in a field called TransType.ie
> document.add(new Field("TransType", "db92fb60-b716-11de-8718-001a4bc7d46e",
> Field.Store.YES, Field.Index.NOT_ANALYZED));
>
> I am using the StandardAnalyser for searching also.
> ie
> IndexSearcher[] indxSearcher = new IndexSearcher[indexNameList.size()];
> for (String indexName : indexNameList) {
>                                        ......................
> }
>
> String[] fields ={ "Path", "TransType"};
> MultiFieldQueryParser queryParser = new MultiFieldQueryParser(fields,new
> StandardAnalyzer());
> Query query = queryParser.parse(qryString);
> ParallelMultiSearcher  parallelMultiSearcher = new
> ParallelMultiSearcher(indxSearcher);
> Hits hits = parallelMultiSearcher.search(query,new Sort(new
> SortField("CreatedTicks",SortField.STRING, true)));
> System.out.println(hits.length());
>
>           But in my TransType search,if I give any of the special
> characters it is displaying the entire list.ie if I search TransType : $ it
> is showing the entire list.But I want Transtype search to work only if I
> give the value which I have
> stored(db92fb60-b716-11de-8718-001a4bc7d46e)....Please help me out to
> resolve this issue
> --
> View this message in context: http://www.nabble.com/Lucene-tp25853791p25853791.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
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