Any lucene query sorts docs by Hamming distance?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Any lucene query sorts docs by Hamming distance?

Yonghui Zhao
Hi,

Is there any query can sort docs by hamming distance if field values are
same length,

Seems fuzzy query only works on edit distance.
Reply | Threaded
Open this post in threaded view
|

Re: Any lucene query sorts docs by Hamming distance?

wmartinusa
Yonghui:

Do you mean sort, rank or score?

Thanks,
Will



> On Dec 22, 2015, at 4:02 AM, Yonghui Zhao <[hidden email]> wrote:
>
> Hi,
>
> Is there any query can sort docs by hamming distance if field values are
> same length,
>
> Seems fuzzy query only works on edit distance.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any lucene query sorts docs by Hamming distance?

Yonghui Zhao
 I mean sort and filter.  I want to filter all documents within some
hamming distances say 3,  and sort them from distance 0 to 3.

2015-12-22 21:42 GMT+08:00 will martin <[hidden email]>:

> Yonghui:
>
> Do you mean sort, rank or score?
>
> Thanks,
> Will
>
>
>
> > On Dec 22, 2015, at 4:02 AM, Yonghui Zhao <[hidden email]> wrote:
> >
> > Hi,
> >
> > Is there any query can sort docs by hamming distance if field values are
> > same length,
> >
> > Seems fuzzy query only works on edit distance.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Any lucene query sorts docs by Hamming distance?

wmartinusa
here’s a thought from the algorithm world:

hamming is the upper bound on levenshtein.

does that help you?

-w


> On Dec 24, 2015, at 4:10 AM, Yonghui Zhao <[hidden email]> wrote:
>
> I mean sort and filter.  I want to filter all documents within some
> hamming distances say 3,  and sort them from distance 0 to 3.
>
> 2015-12-22 21:42 GMT+08:00 will martin <[hidden email]>:
>
>> Yonghui:
>>
>> Do you mean sort, rank or score?
>>
>> Thanks,
>> Will
>>
>>
>>
>>> On Dec 22, 2015, at 4:02 AM, Yonghui Zhao <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> Is there any query can sort docs by hamming distance if field values are
>>> same length,
>>>
>>> Seems fuzzy query only works on edit distance.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Any lucene query sorts docs by Hamming distance?

Jack Krupansky-3
In reply to this post by Yonghui Zhao
Not currently. In fact, FuzzyQuery only supports edit distances up to 2 in
order to guarantee great performance:
https://lucene.apache.org/core/5_4_0/core/org/apache/lucene/search/FuzzyQuery.html?is-external=true

The old, unlimited edit distance version is still semi-supported as
SlowFuzzyQuery, but is deprecated and has been relegated to the sand box,
so it is not really usable going forward:
http://lucene.apache.org/core/5_4_0/sandbox/index.html?org/apache/lucene/sandbox/queries/SlowFuzzyQuery.html


-- Jack Krupansky

On Tue, Dec 22, 2015 at 4:02 AM, Yonghui Zhao <[hidden email]> wrote:

> Hi,
>
> Is there any query can sort docs by hamming distance if field values are
> same length,
>
> Seems fuzzy query only works on edit distance.
>