I see, it's not a single letter, it really a contains.

I think that the best way to do this would be to write your own Query,
similar to WildcardQuery.

Just a warning, this will be really slow compared to other searches Queries
since you will have no defined begin or end points in the set of terms that
you are enumerating. You have to go through the complete list of terms.

Also, you will have to either write your own QueryParser or modify the
current QueryParser to look for the pattern:

*xyz*

and create a ContainsQuery and pass it the text your are looking for.

If you end of adding this functionality, please submit your code so other
who need the same functionality can use it.

I hope this helps

--Peter



On 7/10/02 9:24 PM, "Pradeep Kumar K" <[EMAIL PROTECTED]> wrote:

> Hi Peter
> I want to include an option called "contains " in my search application.
> for  example: Name "contains"  'p' like that...
> Thanks for reply.
> Pradeep
> 
> Peter Carlson wrote:
> 
>> Do you really want to be able to find items by letter? Do you have some
>> other purpose that tokenizing by letter is trying to get around.
>> 
>> If your do want to tokenize by letter, you can create your own tokenizer
>> which creates breaks up items by letter. See the current tokenizers under
>> org.apache.lucene.analysis.
>> 
>> --Peter
>> 
>> On 7/10/02 10:26 AM, "Pradeep Kumar K" <[EMAIL PROTECTED]> wrote:
>> 
>>  
>> 
>>> Hi
>>> 
>>> Is it possible to search for a word contains some letters?
>>> example : "God is love"
>>> 
>>> how can I create query to search for sentences having  "d".
>>> I found that lucene is tokenizing a sentence  in to words not into letters.
>>> is it possible using lucene? Can anybody give a clue for this?
>>> 
>>> 
>>> Thanks
>>> Pradeep
>>> 
>>> 
>>> --------------------------------------------------------------
>>> Robosoft Technologies - Partners in Product Development
>>> 
>>> 
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <mailto:[EMAIL PROTECTED]>
>>> For additional commands, e-mail:
>>> <mailto:[EMAIL PROTECTED]>
>>> 
>>> 
>>>    
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>> 
>>  
>> 
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to