You can use the simplest (but good) FULLTEXT index (
http://www.orientechnologies.com/docs/2.0/orientdb.wiki/FullTextIndex.html )
and use the index prefix to its default value (true). Tune also the
minWordLength as you need.

Then ask the query: SELECT FROM V WHERE location containsText "kansas"

Cheers,
   Riccardo

2015-01-22 19:26 GMT+01:00 Erik Peterson <[email protected]>:

> Thanks for taking a look at this...appears to be a gap in ODB capability
> but maybe I'm missing something. To clarify...
>
> @Jing Yes I think the lucene results are as "designed" but not as
> "desired". Note that the desired search is like "kansas%" not "%kansas%"
>
> @Riccardo
> Yes, prefix, "kansas%", startsWith(searchTerm), etc. type search. Yes,
> search term is variable length.
>
> On Thursday, January 22, 2015 at 11:02:52 AM UTC-7, Riccardo Tasso wrote:
>>
>> Probably Erik has the need of indexing prefixes.
>>
>> Just a question: does your prefixes have a fixed length or you want to be
>> able to perform fast searches on any possible substring of your fields?
>>
>> Cheers,
>>    Riccardo
>>
>> 2015-01-22 17:51 GMT+01:00 Jing Chen <[email protected]>:
>>
>>> Hi Erik,
>>>
>>> The Lucene result looks correct to me. Lucene index tokenizes your
>>> original string and creates index. so
>>>
>>> select location from geo where location lucene "kansas*"
>>>
>>> should be the same as
>>>
>>> select location from geo where location like "%kansas%"
>>>
>>> Jing
>>>
>>>
>>> On Thursday, January 22, 2015 at 8:42:19 AM UTC-8, Erik Peterson wrote:
>>>>
>>>> Apparently OrientDB does not provide a performant "like" search
>>>> capability. Is that correct?
>>>>
>>>> Here's an example.
>>>>
>>>> *1) Returns desired results but 10x slow*
>>>> select from geo where location like "kansas%"
>>>>
>>>> "kansas, united states"
>>>> "kansas city, kansas, united states"
>>>> "kansas city, missouri, united states"
>>>> "kansas, illinois, united states"
>>>>
>>>>
>>>>
>>>> *2) Lucene does not return desired results (for this type of search)*
>>>>
>>>> select location from geo where location lucene "kansas*"
>>>>
>>>> "kansas, united states"
>>>> "abilene, kansas, united states"
>>>> "allen, kansas, united states"
>>>> "alma, kansas, united states"
>>>>
>>>>
>>>> On Tuesday, January 20, 2015 at 1:11:59 AM UTC-7, Erik Peterson wrote:
>>>>>
>>>>> Using 2.0-RC1
>>>>> After some experimenting with queries using like, containstext, and
>>>>> lucene, I have a search where "select from X where like 'abc%" provides 
>>>>> the
>>>>> best results. However it's slow and like can't use indexes correct? Is
>>>>> there another way to emmulate "like" with lucene indexes? (Note that  
>>>>> "select
>>>>> from X where lucene 'abc*" provides very different search behavior from 
>>>>> the
>>>>> simiar "like" query.) Thanks.
>>>>>
>>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "OrientDB" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to