lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <>
Subject Problem using wildcardsearch in phrase search
Date Sat, 12 May 2007 17:02:54 GMT
I seem to be having problems using a * in a phrase term query

This is my search String, its not finding any matches
54:"MusicIP PUID*"

If I match on a particular record it works ok
54:"MusicIP PUIDa39494bf-927e-1638-fb06-782ec55ac22d"

The problem appears to be the space character, because I have another 
situation where there is no space and it works ok.

I use a keyword analyser to create the index so the value 'MusicIP 
PUIDa39494bf-927e-1638-fb06-782ec55ac22d' is stored
as a single value, and then use the same analyser in my search code, 
which is as follows:

public List <Integer> generalSearch(String luceneSearch)
        System.out.println("Search Query Is"+luceneSearch);
        List <Integer> matchingRows = new ArrayList<Integer>();
            IndexSearcher is = new IndexSearcher(directory);

            //Build a query based on the searchString and cached analyzer
            QueryParser parser = new QueryParser(ROW_NUMBER,analyzer);
            Query query = parser.parse(luceneSearch);
            //run the search
            Hits hits =;
            Iterator i = hits.iterator();
                Document doc = ((Hit);
        catch (Exception e)
        return matchingRows;

I cant see what the problem is, thanks paul

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message