あなたの質問には、インデックス(MySQLではデータベースアナログ)を作成する必要があります。このインデックス内では、コンテンツタイプ(MySQLのテーブルなど)を使用する必要があり、各書籍は内部のドキュメントになりますデータ型あなたはどのフィールド
POST library/books/_search
{
"query": {
"term": {
"language": {
"value": "english"
}
}
}
}
またはいずれかのフィールドで文書を検索することができ、この
POST library/books/ISBN-10:1449358543
{
"type": "Paperback",
"pages": 724,
"Publisher": "O'Reilly Media; 1 edition (Feb. 7 2015)",
"language": "English",
"tag": "Elasticsearch: The Definitive Guide Paperback – Feb 7 2015\nby Clinton Gormley (Author), Zachary Tong (Author)",
"desc": "Whether you need full-text search or real-time analytics of structured data—or both—the Elasticsearch distributed search engine is an ideal way to put your data to work. This practical guide not only shows you how to search, analyze, and explore data with Elasticsearch, but also helps you deal with the complexities of human language, geolocation, and relationships.\nIf you’re a newcomer to both search and distributed systems, you’ll quickly learn how to integrate Elasticsearch into your application. More experienced users will pick up lots of advanced techniques. Throughout the book, you’ll follow a problem-based approach to learn why, when, and how to use Elasticsearch features.\nUnderstand how Elasticsearch interprets data in your documents Index and query your data to take advantage of search concepts such as relevance and word proximity Handle human language through the effective use of analyzers and queries Summarize and group data to show overall trends, with aggregations and analytics Use geo-points and geo-shapes—Elasticsearch’s approaches to geolocation Model your data to take advantage of Elasticsearch’s horizontal scalability Learn how to configure and monitor your cluster in production"
}
のようにあなたの本を追加することができます
(MySQLでの行など)combinatイオン
POST library/books/_search
{
"query": {
"bool": {
"should": [
{"term": {
"language": {
"value": "english"
}
}},
{"term": {
"type": {
"value": "paperback"
}
}}
]
}
}
}