0

I have a webcrawler that scrapes Business Names and Business Contact numbers and inserts into ElasticSearch

The problem is i dot NOT want duplicate phone numbers inserted into the column

Is there anyway i can achieve this internally in elasticsearch?

If not, is there a better solution than the below steps

Fetch Record -> Check for Duplicate phone number -> Insert

1 Answer 1

1

You need a unique token filter for this: https://www.elastic.co/guide/en/elasticsearch/reference/1.6/analysis-unique-tokenfilter.html

If the phone numbers are put in the same field of one document, then create a tokenizer that should output as tokens each phone number.

And for this tokenizer define a filter of type unique that will keep the unique tokens. Something around these lines:

  "analyzer": {
    "numbers": {
      "tokenizer": "[whatever]",
      "filter": [
        ...,
        "unique"
      ]
    }
  }
Sign up to request clarification or add additional context in comments.

1 Comment

Could you help out in this stackoverflow.com/questions/31400041/…

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.