Results 1 to 2 of 2
  1. #1
    virendra is offline Member
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Default search with part of string

    Hi,
    I am facing some strange problem in lucene search.
    My lucene document has three field
    1. name
    2. description
    3. themeid

    i am creating my indexes with these three fields.
    I have these scenario in search.
    I have text field where user can enter keyword to be searched.
    Now one document has name Stallion.
    If user enter Stallion in search field it gives search result to him.
    But one user enters sta in search field it does not give any result.
    I need to show all the document which has sta in their name in this case.

    I am creating index for name field
    cardDocument
    .add(new Field(CardSearchField.name.toString(), card
    .getName(), Field.Store.YES,
    Field.Index.ANALYZED));
    I dont know why lucene is not giving any result for partial string.
    Please tell me what i have to do to enable this search algorithm.


    Regards
    Virendra
    Last edited by virendra; 01-07-2010 at 09:57 AM.

  2. #2
    Ervin is offline Member
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Default search with part of string

    In Lucene, you need to turn on wildcard capability, it's not enabled by default however in Solr, it is enabled by default. You can check out more here:
    Wildcard Searches - Search by Lucid Imagination

    Cheers
    Ervin

Similar Threads

  1. Problem with empty search string
    By virendra in forum Lucene
    Replies: 0
    Last Post: 01-06-2010, 11:42 AM
  2. Search string for non-alphabetic characters
    By turnergirl24 in forum New To Java
    Replies: 5
    Last Post: 10-16-2009, 03:02 AM
  3. Search a string in a byte array
    By 2BOrNot2B in forum New To Java
    Replies: 0
    Last Post: 03-12-2009, 06:52 PM
  4. How to get part of a String?
    By eva in forum New To Java
    Replies: 1
    Last Post: 12-23-2007, 07:58 AM
  5. Replies: 0
    Last Post: 11-20-2007, 05:59 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
  •