分析器未添加到Elasticsearch DSL的字段中

时间:2015-06-25 12:54:05

标签: elasticsearch stemming elasticsearch-dsl

我正在使用elasticsearch-dsl-py 0.0.5和https://github.com/HonzaKral/es-django-example的示例用于Django。

我有一个DocType:

function flip1(){
    $('#category-1').delay(100).css('display', 'none');
    $('.box-1').delay(100).css('display', 'block');
    $('.box-1').transition({
        perspective: '100px',
        rotateY: '360deg'


        width: 100px;
        height: 100px;
        background: red;
        -webkit-transition: transform 0.3s;
        transform:scaleX(1);
        animation-name: example;
        animation-duration: 0.3s;    
    }

    @keyframes example {
        25%  {transform:scaleX(0.060);}
        50%  {transform:scaleX(0.500);}
        75%  {transform:scaleX(0.700);}
        100% {transform:scaleX(1);}
    }     
      },200)  
    setTimeout(startSlidecat1, 2000);
  }

我使用下面的管理命令更新我的索引。 class PageDoc(DocType): title = String(analyzer='snowball') index = Index('my_index') index.doc_type(PageDoc) 是我想要索引的Django模型。

Page

http://127.0.0.1:9200/my_index/_mapping?pretty的(简化)输出是:

class Command(BaseCommand):
    def handle(self, *args, **kwargs):
        self.es = connections.get_connection()
        index.delete(ignore=404)
        index.create()
        self.verbose_run(Page)

    def verbose_run(self, model, report_every=100):
        name = model._meta.verbose_name
        print('Indexing %s: ' % name, end='')
        start = time.time()
        cnt = 0
        for _ in streaming_bulk(
                self.es,
                (m.to_search().to_dict(True) for m in model.objects.all().iterator()),
                index=settings.ES_INDEX,
                doc_type=name.lower()):
            cnt += 1
            if cnt % report_every:
                print('.', end='')

        print('DONE\nIndexing %d %s in %.2f seconds' % (
            cnt, name, time.time() - start
        ))

我可以查询完全匹配,但是阻塞不起作用。为什么雪球分析仪没有添加到标题栏?

0 个答案:

没有答案