Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elasticstack Mapping issue with elastic search 2.3.2 #21

Closed
X17 opened this issue May 2, 2016 · 3 comments
Closed

Elasticstack Mapping issue with elastic search 2.3.2 #21

X17 opened this issue May 2, 2016 · 3 comments

Comments

@X17
Copy link

X17 commented May 2, 2016

I have tried every step from documentation:
But have not been able to achieve mapping via elastic stack. when i try

./manage.py rebuild_index

In sense terminal :

GET haystack/_settings
{
   "haystack": {
      "settings": {
         "index": {
            "creation_date": "1462163781086",
            "number_of_shards": "1",
            "number_of_replicas": "1",
            "uuid": "A4pRJ-qISlOOxcsYNqZwvg",
            "version": {
               "created": "2030199"
            }
         }
      }
   }
}

If I try mapping using Sense chrome extension:

GET haystack/_settings
{
   "haystack": {
      "settings": {
         "index": {
            "creation_date": "1461757315198",
            "analysis": {
               "filter": {
                  "nGram_filter": {
                     "token_chars": [
                        "letter",
                        "digit",
                        "punctuation",
                        "symbol"
                     ],
                     "min_gram": "2",
                     "type": "nGram",
                     "max_gram": "20"
                  }
               },
               "analyzer": {
                  "nGram_analyzer": {
                     "filter": [
                        "lowercase",
                        "asciifolding",
                        "nGram_filter"
                     ],
                     "type": "custom",
                     "tokenizer": "whitespace"
                  },
                  "whitespace_analyzer": {
                     "filter": [
                        "lowercase",
                        "asciifolding"
                     ],
                     "type": "custom",
                     "tokenizer": "whitespace"
                  }
               }
            },
            "number_of_shards": "1",
            "number_of_replicas": "1",
            "uuid": "HngScPJJQcedP2l2PnFeNw",
            "version": {
               "created": "2030199"
            }
         }
      }
   }
}

Thanks in advance.

@X17 X17 closed this as completed May 2, 2016
@X17 X17 reopened this May 5, 2016
@bennylope
Copy link
Owner

I'm sorry, but I have no idea what you're asking or what problem you'd like help diagnosing.

@X17
Copy link
Author

X17 commented May 5, 2016

I am facing issue with elasticstack.

python manage.py show_mapping

{
   "core": {
      "mappings": {
         "modelresult": {
            "properties": {
               "django_ct": {
                  "type": "string"
               },
               "django_id": {
                  "type": "string"
               },
               "id": {
                  "type": "string"
               },
               "text": {
                  "type": "string"
                  "analyzer" : "custom_analyzer"
                  "search_analyzer" : "custom_search_analyzer"
               },
               "university": {
                  "type": "string"
                  "analyzer" : "custom_analyzer"
                  "search_analyzer" : "custom_search_analyzer"

               }
            }
         }
      }
   }
}

When I rebuild_index and try to access elastic search mapping using GET /index/_mapping

it gives the following mapping json

{
   "core": {
      "mappings": {
         "modelresult": {
            "properties": {
               "django_ct": {
                  "type": "string"
               },
               "django_id": {
                  "type": "string"
               },
               "id": {
                  "type": "string"
               },
               "text": {
                  "type": "string"
               },
               "university": {
                  "type": "string"
               }
            }
         }
      }
   }
}

I don't know why there is no analyzer field although I have followed every step.

When I debug and try to get the mapping value in backends.py it has analyzer and search_analyzer field but when I try to get the index mapping value from elasticsearch, it gives me above mapping.
thanks in advance.

@X17 X17 changed the title Elasticstack Mapping issue Elasticstack Mapping issue with elastic search 2.3.2 May 9, 2016
@X17
Copy link
Author

X17 commented May 9, 2016

The code does not work for indexing as it returns 400 because _boost has been deprecated from elasticsearch but haystack 2.4.1 build had _boost variable in elasticsearch_backend.py on line 138.

Solved the issue.

@X17 X17 closed this as completed May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants