Help us understand the problem. What is going on with this article?

ElasticSearch 検索方法まとめ

More than 5 years have passed since last update.

一般的なテキストサーチ

curl -XPOST "http://localhost:9200/_search" -d'
{
    "query": {
        "query_string": {
            "query": "検索テキスト!"
        }
    }
}'

公式ドキュメント
Query String Query

インデックス・クエリー

{
    "indices" : {
        "indices" : ["index1", "index2"],
        "query" : {
            "term" : { "tag" : "wow" }
        },
        "no_match_query" : {
            "term" : { "tag" : "kow" }
        }
    }
}

Indices Query

クエリーの形

{
        size: # number of results to return (defaults to 10)
        from: # offset into results (defaults to 0)
        fields: # list of document fields that should be returned - http://elasticsearch.org/guide/reference/api/search/fields.html
        sort: # define sort order - see http://elasticsearch.org/guide/reference/api/search/sort.html

        query: {
            # "query" object following the Query DSL: http://elasticsearch.org/guide/reference/query-dsl/
            # details below
        },

        facets: {
            # facets specifications
            # Facets provide summary information about a particular field or fields in the data
        }

        # special case for situations where you want to apply filter/query to results but *not* to facets
        filter: {
            # filter objects
            # a filter is a simple "filter" (query) on a specific field.
            # Simple means e.g. checking against a specific value or range of values
        }
}

検索用語

ElasticSearch, query, search, text, string, schema, filter
クエリー, サーチ, 検索, テキスト,

hshimo
ブロックチェーン専門企業、コンセンサス・ベイス代表、志茂 博の技術メモ。 興味ある方は、日本ブロックチェーンユーザ会へ。http://crypto-tech.jp/
https://www.consensus-base.com/
consensus-base
ブロックチェーン技術の専門企業。大企業様を中心に国内有数の実証実験・開発の実績があり、様々な実装の経験・ノウハウがある。
https://www.consensus-base.com
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away