FAQ
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

Search Discussions

  • Ian Lea at Oct 12, 2009 at 11:08 am
    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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedOct 12, '09 at 10:56a
activeOct 12, '09 at 11:08a
posts2
users2
websitelucene.apache.org

2 users in discussion

Ian Lea: 1 post Nja: 1 post

People

Translate

site design / logo © 2022 Grokbase