solr query-获取结果而不扫描文件 [英] solr query- get results without scanning files

查看:112
本文介绍了solr query-获取结果而不扫描文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想执行一个solr查询,只得到我定义的uniquKey。

文件非常大,所以定义fl ='my_key'不够快 - 所有匹配的文件都是仍然扫描,查询可能需要几个小时(即使搜索本身很快 - numFound需要几秒钟才能返回)。

我应该提到所有数据都已存储,并且创建新索引不是选项。

I would like to execute a solr query and get only the uniquKey I've defined.
The documents are very big so defining fl='my_key' is not fast enough - all the matching documents are still scanned and the query can take hours (even though the search itself was fast - numFound takes few seconds to return).
I should mention that all the data is stored, and creating a new index is not an option.

我有一个想法是获取结果的docIds并将它们映射到代码中的my_key。

我使用fl = [ docid,认为它不需要扫描来获取这些信息,但它仍然需要很长时间才能返回。

One idea I had was to get the docIds of the results and map them to my_key in the code.
I used fl=[docid], thinking it doesn't need scanning to get this info, but it still takes too long to return.

有没有更好的方法来获取docIds? br>
或者一种在没有重新索引的情况下取消存储某些字段的方法?

或者在不扫描所有字段的情况下以完全不同的方式获得结果?

Is there a better way to get the docIds?
Or a way to unstore certain fields without reindexing?
Or perhapse a compeletly different way to get the results without scanning all the fields?

谢谢,

Dafna

推荐答案

对不起,但是唯一的方法是o不止一个地打破你的巨大文件。我不知道如何仅匹配您指定的字段并单独放置文档。这不是Lucene的工作方式。

Sorry, but the only way is to break your gigantic documents in more than one. I don't see how it will be possible to only match the fields you specified and let the documents alone. This is not how Lucene works.

可以制作一个文档,该文档仅使用查询所需的索引字段来简化工作,或者根据所需的查询中断文档。或者只是添加具有这些新查询所需结构的其他文档。这取决于你。

One could make a document that used only indexed fields that are needed to query to turn the job easier, or break the document based on the queries that are needed. Or simply adding another documents with the structure needed for these new queries. It's up to you.

这篇关于solr query-获取结果而不扫描文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆