0

I'm trying to perform the following query through ElasticSearch Java API

{
 "query" : {
    "fuzzy" : {
        "dateOfBirth" : {
            "value" : "1944-11-30",
            "fuzziness" : "365d"
        }
    }
 }
}

I doesn't understand how to specify the fuzzines value for 365 days in this kind of query.

1 Answer 1

1

You can use this:

FuzzyQueryBuilder queryBuilder = fuzzyQuery("dateOfBirth" ,"1944-11-30" ).fuzziness(Fuzziness.build("365d"))

Hope this helps

Sign up to request clarification or add additional context in comments.

2 Comments

Thank's for your help. I've notice that the Fuzziness constructor is private, so I used the static build method provided by the Fuzziness class.
Ohh I did not notice. Yes you should use build Method . Updated my answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.