Results 1 to 2 of 2
  1. #1
    peliukasss is offline Member
    Join Date
    Feb 2010
    Posts
    21
    Rep Power
    0

    Default How to display WildCard search values

    Hi,

    I'm searching using wildcard search.
    For e.g I'm searching for String hou*

    And I want to print all results for e.g:
    house
    houses
    housewives and so on...

    I'm using this :

    Java Code:
                Term term = new Term("fieldname", word);
                Query query = new WildcardQuery(term);
    
                int hitsPerPage = 50;
                IndexSearcher searcher = new IndexSearcher(directory, true);
                TopScoreDocCollector collector = TopScoreDocCollector.create(hitsPerPage, true);
                searcher.search(query, collector);
                ScoreDoc[] hits = collector.topDocs().scoreDocs;
                System.out.println("Found " + hits.length + " hits.");
                Document hitDoc = null;
                for (int i = 0; i < hits.length; ++i) {
                ???????????????
                }
    How can I display all words of wildcard search?

  2. #2
    peliukasss is offline Member
    Join Date
    Feb 2010
    Posts
    21
    Rep Power
    0

    Default

    Any help?

    Please I need this very much......

    I tried to highlight query but it takes a very long time because my field length is very big and even so.. It doesn't gives me all wildcard search results. I'm sure that there is the word in field, but in result the word is not showed. Maybe I have a bad understanding of method getBestFragment, any help on explaining this method purpose would be very appreciated.

Similar Threads

  1. Replies: 2
    Last Post: 06-17-2010, 12:44 PM
  2. Replies: 0
    Last Post: 10-29-2009, 09:28 AM
  3. Replies: 27
    Last Post: 08-27-2009, 03:05 PM
  4. i want to display decimal values in frame window
    By santhosh_el in forum AWT / Swing
    Replies: 4
    Last Post: 03-16-2009, 09:07 AM
  5. Replies: 5
    Last Post: 08-26-2008, 03:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •