Help mapping in elasticsearch for searching content

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Help mapping in elasticsearch for searching content

Jin Nguyen
Hi all,

I setup an elasticsearch to search for my website and need to mapping some settings to index, this my settings config:

"settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "whitespace",
          "filter": [ "my_stop_word", "my_lowercase", "my_ascii_folding" ]
        }
      },
      "filter" : {
        "my_stop_word": {
          "type": "stop",
          "stopwords": "_english_"
        },
        "my_lowercase": {
          "type": "lowercase"
        },
        "my_ascii_folding": {
          "type": "asciifolding"
        }
      }
   }
}

This is mapping of index:

"properties" : {
      "actors" : {
        "type" : "string",
        "fields" : {
          "actors" : {
            "type" : "string",
            "omit_norms" : "true",
            "index_options" : "docs"
          },
          "my_analyzer_ngram" : {
            "type" : "string",
            "analyzer" : "my_analyzer",
            "include_in_all" : "false"
          }
        }
      },
   ....


It search ok, but do not action something like google when I type something wrong, google will remind "Did you mean that?". Example:

If I type "King of thrones" to search with my db, of course db doesn't has any film named it like this, I expect that search engine will give a clue "Game of thrones" for user. That's mean if user search do not exactly, my website still can give a true result for them.

Thanks in advanced

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/21d84d3b-d624-4c63-9329-e9c4059b0a73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Help mapping in elasticsearch for searching content

Doug Turnbull
Hello Jin

I don't see here how you're searching, but there's nothing in the default searches that provides this functionality. You want to look into Elasticsearch's suggestiers feature
http://www.elastic.co/guide/en/elasticsearch/reference/1.5/search-suggesters.html

-Doug

On Mon, Apr 13, 2015 at 9:49 PM, Jin Nguyen <[hidden email]> wrote:
Hi all,

I setup an elasticsearch to search for my website and need to mapping some settings to index, this my settings config:

"settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "whitespace",
          "filter": [ "my_stop_word", "my_lowercase", "my_ascii_folding" ]
        }
      },
      "filter" : {
        "my_stop_word": {
          "type": "stop",
          "stopwords": "_english_"
        },
        "my_lowercase": {
          "type": "lowercase"
        },
        "my_ascii_folding": {
          "type": "asciifolding"
        }
      }
   }
}

This is mapping of index:

"properties" : {
      "actors" : {
        "type" : "string",
        "fields" : {
          "actors" : {
            "type" : "string",
            "omit_norms" : "true",
            "index_options" : "docs"
          },
          "my_analyzer_ngram" : {
            "type" : "string",
            "analyzer" : "my_analyzer",
            "include_in_all" : "false"
          }
        }
      },
   ....


It search ok, but do not action something like google when I type something wrong, google will remind "Did you mean that?". Example:

If I type "King of thrones" to search with my db, of course db doesn't has any film named it like this, I expect that search engine will give a clue "Game of thrones" for user. That's mean if user search do not exactly, my website still can give a true result for them.

Thanks in advanced

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/21d84d3b-d624-4c63-9329-e9c4059b0a73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Doug Turnbull Search Relevance Consultant | OpenSource Connections, LLC | 240.476.9983 | http://www.opensourceconnections.com 
Author: Taming Search from Manning Publications
This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALG6HL8vZjMtkGAt%2BD8WROMdF-uv5a7Q7kx_sB9bx22zDRrJcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Help mapping in elasticsearch for searching content

Jin Nguyen
Hi Doug,

These above settings just apart of my searching. It's make my index searchable. And I want to optimize this system as I said. Thanks for your reply

On Tuesday, April 14, 2015 at 9:17:08 AM UTC+7, Doug Turnbull wrote:
Hello Jin

I don't see here how you're searching, but there's nothing in the default searches that provides this functionality. You want to look into Elasticsearch's suggestiers feature
<a href="http://www.elastic.co/guide/en/elasticsearch/reference/1.5/search-suggesters.html" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elastic.co%2Fguide%2Fen%2Felasticsearch%2Freference%2F1.5%2Fsearch-suggesters.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFClYDtv9XgHzLxTqMgXuhtLCK0gw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elastic.co%2Fguide%2Fen%2Felasticsearch%2Freference%2F1.5%2Fsearch-suggesters.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFClYDtv9XgHzLxTqMgXuhtLCK0gw';return true;">http://www.elastic.co/guide/en/elasticsearch/reference/1.5/search-suggesters.html

-Doug

On Mon, Apr 13, 2015 at 9:49 PM, Jin Nguyen <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="jCFm0h_AdQYJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">jin...@...> wrote:
Hi all,

I setup an elasticsearch to search for my website and need to mapping some settings to index, this my settings config:

"settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "whitespace",
          "filter": [ "my_stop_word", "my_lowercase", "my_ascii_folding" ]
        }
      },
      "filter" : {
        "my_stop_word": {
          "type": "stop",
          "stopwords": "_english_"
        },
        "my_lowercase": {
          "type": "lowercase"
        },
        "my_ascii_folding": {
          "type": "asciifolding"
        }
      }
   }
}

This is mapping of index:

"properties" : {
      "actors" : {
        "type" : "string",
        "fields" : {
          "actors" : {
            "type" : "string",
            "omit_norms" : "true",
            "index_options" : "docs"
          },
          "my_analyzer_ngram" : {
            "type" : "string",
            "analyzer" : "my_analyzer",
            "include_in_all" : "false"
          }
        }
      },
   ....


It search ok, but do not action something like google when I type something wrong, google will remind "Did you mean that?". Example:

If I type "King of thrones" to search with my db, of course db doesn't has any film named it like this, I expect that search engine will give a clue "Game of thrones" for user. That's mean if user search do not exactly, my website still can give a true result for them.

Thanks in advanced

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jCFm0h_AdQYJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">elasticsearc...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/elasticsearch/21d84d3b-d624-4c63-9329-e9c4059b0a73%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/21d84d3b-d624-4c63-9329-e9c4059b0a73%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/21d84d3b-d624-4c63-9329-e9c4059b0a73%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/21d84d3b-d624-4c63-9329-e9c4059b0a73%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.



--
Doug Turnbull Search Relevance Consultant | OpenSource Connections, LLC | 240.476.9983 | <a href="http://www.opensourceconnections.com/" style="color:rgb(17,85,204)" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.opensourceconnections.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNENYzeUvLLGbDwBce8aGJDfHfsN2g';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.opensourceconnections.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNENYzeUvLLGbDwBce8aGJDfHfsN2g';return true;">http://www.opensourceconnections.com 
Author: <a href="http://manning.com/turnbull" style="font-style:italic;color:rgb(17,85,204);font-size:13px;font-family:Helvetica" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmanning.com%2Fturnbull\46sa\75D\46sntz\0751\46usg\75AFQjCNFazDwbgqS0hdRlNmV8GuhTrLVEKg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmanning.com%2Fturnbull\46sa\75D\46sntz\0751\46usg\75AFQjCNFazDwbgqS0hdRlNmV8GuhTrLVEKg';return true;">Taming Search from Manning Publications
This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/70438847-9be4-492e-8a88-24c0a0a90cc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.