Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python elasticsearch没有';t删除所有HTML或stopwords_Python_Wordpress_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch - Fatal编程技术网 elasticsearch,Python,Wordpress,elasticsearch" /> elasticsearch,Python,Wordpress,elasticsearch" />

Python elasticsearch没有';t删除所有HTML或stopwords

Python elasticsearch没有';t删除所有HTML或stopwords,python,wordpress,elasticsearch,Python,Wordpress,elasticsearch,我把我的wordpress帖子扔到Elasticsearch上,但在搜索建议词时,我仍然得到stopwords和html元素。例如,the,a甚至p标签。我已经在索引中指定使用这些过滤器 这是我的密码 es.indices.create( index='wp-posts', body={ 'settings': { # just one shard, no replicas for testing 'number_o

我把我的wordpress帖子扔到Elasticsearch上,但在搜索建议词时,我仍然得到stopwords和html元素。例如,
the
a
甚至
p
标签。我已经在索引中指定使用这些过滤器

这是我的密码

es.indices.create(
    index='wp-posts',
    body={
        'settings': {
            # just one shard, no replicas for testing
            'number_of_shards': 1,
            'number_of_replicas': 0,

            # custom analyzer for analyzing file paths
            'analysis': {
                'analyzer': {
                    "my_analyzer": { 
                        "type": "standard", 
                        "stopwords": "_english_"
                    },
                    'wordpress_content': {
                        'type': 'custom',
                        'tokenizer': 'standard',
                        'filter': ['html_strip']
                        }
                    }
                }
            }
        },
    # Will ignore 400 errors, remove to ensure you're prompted
    ignore=400
)
这就是我寻求建议的方式。除非我做错了什么

result = es.suggest(index="wp-posts", body={"my_suggestion": {"text": post['content'], "term": {"field":"content" }}})