Skip to content

Instantly share code, notes, and snippets.

@mishu-
Last active December 25, 2015 14:39
Show Gist options
  • Save mishu-/6992870 to your computer and use it in GitHub Desktop.
Save mishu-/6992870 to your computer and use it in GitHub Desktop.

Analyzer settings:

{
index.version.created: "900299",
index.number_of_replicas: "1",
index.number_of_shards: "5",
index.analysis.analyzer.tweet_analyzer.filter.1: "tweet_filter",
index.mappings.mention.properties.content.type: "string",
index.analysis.analyzer.tweet_analyzer.filter.0: "lowercase",
index.analysis.analyzer.tweet_analyzer.tokenizer: "whitespace",
index.analysis.filter.tweet_filter.type: "word_delimiter",
index.analysis.filter.tweet_filter.type_table.0: "# => ALPHA",
index.mappings.mention.properties.content.analyzer: "tweet_analyzer",
index.analysis.filter.tweet_filter.type_table.1: "@ => ALPHA",
index.analysis.analyzer.tweet_analyzer.type: "custom"
}

Document that should match: #apple and pie

Query:

{
  "query": {
    "filtered": {
      "query": {
        "bool": {
          "must": [
            {
              "query_string": {
                "query": "\"#apple\"",
                "analyzer": "tweet_analyzer"
              }
            }
          ]
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment