2012-12-21 12 views
8

मैंने प्ले 2 और लोचदार खोज में एक छोटा ऐप बनाया है जो मेरे अन्य अनुप्रयोगों को स्वत: पूर्ण सुविधा प्रदान करेगा। अब मेरे लोचदार खोज उदाहरण को उत्पादन में स्थानांतरित करने का समय है।मेरा लोचदार खोज उदाहरण ऊपर और चल रहा है, चलो इसे उत्पादन में ले जाएं।

मानचित्रण:

curl -XPUT 'http://127.0.0.1:9200/auto_complete/?pretty=1' -d ' 
{ 
    "mappings": { 
     "search_word": { 
      "_all": { 
       "enabled": false 
      }, 
      "properties": { 
       "id": { 
        "type": "string" 
       }, 
       "word": { 
        "fields": { 
         "ngrams": { 
          "type": "string", 
          "analyzer": "custom_ngram" 
         }, 
         "full": { 
          "type": "string", 
          "search_analyzer": "custom_full", 
          "index_analyzer": "custom_full" 
         } 
        }, 
        "type": "multi_field" 
       }, 
       "word_type": { 
        "type": "string" 
       } 
      } 
     } 
    }, 
    "settings": { 
     "analysis": { 
      "filter": { 
       "customnGram": { 
        "max_gram": 50, 
        "min_gram": 2, 
        "type": "edgeNGram" 
       } 
      }, 
      "analyzer": { 
       "custom_ngram": { 
        "filter": [ 
         "standard", 
         "lowercase", 
         "customnGram" 
        ], 
        "type": "custom", 
        "tokenizer": "standard" 
       }, 
       "custom_full": { 
        "filter": [ 
         "standard", 
         "lowercase" 
        ], 
        "type": "custom", 
        "tokenizer": "standard" 
       } 
      } 
     } 
    } 
} 
' 

आप के लिए कुछ परीक्षण डेटा:

curl -XPOST 'http://127.0.0.1:9200/_bulk?pretty=1' -d ' 
{"index" : {"_index" : "auto_complete", "_type" : "search_word"}} 
{"word" : "vvs", "word_type":"STRONG_SEARCH_WORD"} 
{"index" : {"_index" : "auto_complete", "_type" : "search_word"}} 
{"word" : "och VVS ab", "word_type":"WEAK_SEARCH_WORD"} 
{"index" : {"_index" : "auto_complete", "_type" : "search_word"}} 
{"word" : "vvs och rörjouren", "word_type":"NAME"} 
{"index" : {"_index" : "auto_complete", "_type" : "search_word"}} 
{"word" : "vvs & rörjouren", "word_type":"NAME"} 
{"index" : {"_index" : "auto_complete", "_type" : "search_word"}} 
{"word" : "rot och vvs", "word_type":"NAME"} 
{"index" : {"_index" : "auto_complete", "_type" : "search_word"}} 
{"word" : "vvsjouren", "word_type":"NAME"} 
{"index" : {"_index" : "auto_complete", "_type" : "search_word"}} 
{"word" : "vvs-jouren", "word_type":"NAME"} 
' 

आप के लिए एक परीक्षण क्वेरी:

curl -XGET 'http://127.0.0.1:9200/auto_complete/search_word/_search?pretty=1' -d ' 
{ 
    "query": { 
     "bool": { 
      "should": [ 
       { 
        "text": { 
         "search_word.ngrams": { 
          "operator": "and", 
          "query": "vvs" 
         } 
        } 
       }, 
       { 
        "text": { 
         "search_word.full": { 
          "boost": 1, 
          "query": "vvs" 
         } 
        } 
       } 
      ] 
     } 
    } 
} 
' 

परीक्षण करते समय मैं डिफ़ॉल्ट मोड में इंस्टेंस चला रहा हूं। वर्तमान में मेरे पास लगभग 1 मिलियन दस्तावेज़ हैं।

अगर मैं कार्य करें:

curl http://127.0.0.1:9200/auto_complete/_stats?pretty=1 

मैं:

    :

    { 
        "auto_complete": { 
         "primaries": { 
          "docs": { 
           "count": 971133, 
           "deleted": 0 
          }, 
          "store": { 
           "size": "224.6mb", 
           "size_in_bytes": 235552784, 
           "throttle_time": "0s", 
           "throttle_time_in_millis": 0 
          }, 
          "indexing": { 
           "index_total": 971126, 
           "index_time": "4m", 
           "index_time_in_millis": 242450, 
           "index_current": 0, 
           "delete_total": 0, 
           "delete_time": "0s", 
           "delete_time_in_millis": 0, 
           "delete_current": 0 
          }, 
          "get": { 
           "total": 0, 
           "time": "0s", 
           "time_in_millis": 0, 
           "exists_total": 0, 
           "exists_time": "0s", 
           "exists_time_in_millis": 0, 
           "missing_total": 0, 
           "missing_time": "0s", 
           "missing_time_in_millis": 0, 
           "current": 0 
          }, 
          "search": { 
           "query_total": 45, 
           "query_time": "1.1s", 
           "query_time_in_millis": 1152, 
           "query_current": 0, 
           "fetch_total": 35, 
           "fetch_time": "50ms", 
           "fetch_time_in_millis": 50, 
           "fetch_current": 0 
          } 
         }, 
         "total": { 
          "docs": { 
           "count": 971133, 
           "deleted": 0 
          }, 
          "store": { 
           "size": "224.6mb", 
           "size_in_bytes": 235552784, 
           "throttle_time": "0s", 
           "throttle_time_in_millis": 0 
          }, 
          "indexing": { 
           "index_total": 971126, 
           "index_time": "4m", 
           "index_time_in_millis": 242450, 
           "index_current": 0, 
           "delete_total": 0, 
           "delete_time": "0s", 
           "delete_time_in_millis": 0, 
           "delete_current": 0 
          }, 
          "get": { 
           "total": 0, 
           "time": "0s", 
           "time_in_millis": 0, 
           "exists_total": 0, 
           "exists_time": "0s", 
           "exists_time_in_millis": 0, 
           "missing_total": 0, 
           "missing_time": "0s", 
           "missing_time_in_millis": 0, 
           "current": 0 
          }, 
          "search": { 
           "query_total": 45, 
           "query_time": "1.1s", 
           "query_time_in_millis": 1152, 
           "query_current": 0, 
           "fetch_total": 35, 
           "fetch_time": "50ms", 
           "fetch_time_in_millis": 50, 
           "fetch_current": 0 
          } 
         } 
        } 
    } 
    

    मैं configuration के माध्यम से पढ़ा है, लेकिन मैं क्या चाहते हैं चेकलिस्ट के कुछ प्रकार है

  1. लॉगफाइल पथ बदलें
  2. अपने सूचकांक एक्स आप एक्स के -Xmx और -Xms स्थापित करना चाहिए और वाई
  3. तरह लग रहा है के बाद से अपने सूचकांक एक्स आप एक्स नोड्स का उपयोग करना चाहिए और वाई
  4. प्रतिकृतियां निकालें तरह लग रहा है के बाद से सभी सुंदर प्रश्नों में
  5. आपके सबसे अधिक इस्तेमाल किए जाने वाले प्रश्नों के लिए आपको उन्हें
  6. गर्म करने की आवश्यकता है यदि आप _all फ़ील्ड सेट "_all" का उपयोग नहीं करते हैं: {"सक्षम": false}
  7. ?

तो क्या मैं के लिए यहाँ देख रहा हूँ है: क्या अपनी कहानी जब उत्पादन और विन्यास आप किस प्रकार का क्या किया में जाने अपने सूचकांक सुचारू रूप से संचालित करने के लिए। क्या आपके पास मेरे लिए कोई सुझाव है, या किसी के लिए जो उत्पादन में आगे बढ़ रहा है?

उत्तर

2

आप इस ब्लॉग पोस्ट में एक "ELASTICSEARCH उड़ान-पूर्व जांच सूची" पा सकते हैं:

http://asquera.de/opensource/2012/11/25/elasticsearch-pre-flight-checklist/

यह बुनियादी विन्यास, स्मृति सेटिंग, नाम संकल्प और भी बहुत कुछ शामिल किया गया।

+0

हां बिल्कुल! लेकिन अपने उत्तर को अपडेट करें ताकि इसमें न केवल एक लिंक शामिल हो जैसा कि यहां चर्चा की गई है: http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links- कहीं--ally- अच्छा- उत्तर? lq = 1 और मैं इसे सही के रूप में जांचूंगा! – jakob

संबंधित मुद्दे