Results 1 to 2 of 2
Thread: search with part of string
- 01-07-2010, 08:25 AM #1
Member
- Join Date
- Jan 2010
- Posts
- 4
- Rep Power
- 0
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
VirendraLast edited by virendra; 01-07-2010 at 08:57 AM.
- 01-21-2010, 12:56 PM #2
Member
- Join Date
- Jan 2010
- Posts
- 4
- Rep Power
- 0
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
-
Problem with empty search string
By virendra in forum LuceneReplies: 0Last Post: 01-06-2010, 10:42 AM -
Search string for non-alphabetic characters
By turnergirl24 in forum New To JavaReplies: 5Last Post: 10-16-2009, 02:02 AM -
Search a string in a byte array
By 2BOrNot2B in forum New To JavaReplies: 0Last Post: 03-12-2009, 05:52 PM -
How to get part of a String?
By eva in forum New To JavaReplies: 1Last Post: 12-23-2007, 06:58 AM -
Using java.util.Scanner to search for a String in a String
By Java Tip in forum Java TipReplies: 0Last Post: 11-20-2007, 04:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks