lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Aksoy <ahme...@axtelsoft.com>
Subject Query returns an empty result set; but it is not empty actually!
Date Wed, 05 Oct 2005 19:43:41 GMT
Hi,
I have a dictionary. It is indexed as follows:

    private Document buildDocument(SozlukBirimi birim){
        Document doc = new Document();
        doc.add(Field.Keyword("soz", birim.getSoz()));
        doc.add(Field.Text("soz1", birim.getSoz()));
        doc.add(Field.Text("anlam", birim.getAnlam()));
        return doc;
    }

And my query is defined as:

    public List gelismisAnlamAra(String sorgu) throws ParseException
    {
        if(sorgu==null || sorgu.length()<2)
          return Collections.EMPTY_LIST;
        try
        {
            IndexSearcher searcher = new 
IndexSearcher(Indeksleyici.getRootDir()+Indeksleyici.INDEX_ROOT);
            Query q = QueryParser.parse(sorgu, "anlam", new 
TurkishAnalyser());
            Hits hits = searcher.search(q);
            return sonuclariIsle(hits);
        } catch (IOException e)
        {
            e.printStackTrace();
            return Collections.EMPTY_LIST;
        }
    }

TurkishAnalyzer is very simple!

public class TurkishAnalyser extends StandardAnalyzer
{
    private static Set _stopTable;

    public static final String[] STOP_WORDS =
            {
            ",", "$", ";", "-", ".",":"
            };
}

Some single Turkish words "menteşe", "eczane", "menekşe" returns an 
empty list for the query.
However, when a "*", or a "?" appended at the end of the query string, 
it returns the actual words in the result set.
What might the reason for that problem?
IMHO, Turkish characters do not have an affect on the problem. For 
example in "eczane" there is no special Turkish characters, but it has 
the same problem.

Ahmet Aksoy


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