Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query DSL: Fuzzy query support for numeric / date types #907

Closed
kimchy opened this issue May 5, 2011 · 0 comments

Comments

@kimchy
Copy link
Member

commented May 5, 2011

Support the notion of fuzzy query for numeric types and dates. fuzzy query on a numeric field will result in a range query "around" the value using the min_similarity value. For example:

{
    "fuzzy" : {
        "price" : {
            "value" : 12,
            "min_similarity" : 2
        }
    }
}

Will result in a range query between 10 and 14. Same applies to dates, with support for time format for the min_similarity field:

{
    "fuzzy" : {
        "created" : {
            "value" : "2010-02-05T12:05:07",
            "min_similarity" : "1d"
        }
    }
}

In the mapping, numeric and date types now allow to configure a fuzzy_factor mapping value (defaults to 1), which will be used to multiply the fuzzy value by it when used in a query_string type query. For example, for dates, a fuzzy factor of "1d" will result in multiplying whatever fuzzy value provided in the min_similarity by it. Note, this is explicitly supported since query_string query only allowed for similarity valued between 0.0 and 1.0.

@kimchy kimchy closed this in 0f78100 May 5, 2011

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.