How to select distinct field values using Solr?

前端 未结 6 1066
别跟我提以往
别跟我提以往 2020-11-28 04:01

I would like to do the equivalent of this SQL but with Solr as my data store.

SELECT
   DISTINCT txt
FROM
   my_table;

What syntax would fo

6条回答
  •  情深已故
    2020-11-28 04:39

    For the DISTINCT part of your question, I think you may be looking for Solr's field collapsing / grouping functions. It will enable you to specify a field you want unique results from, create a group on those unique values and it will show you how many documents are that group.

    You can then use the same substr stored in a separate field, and collapse on that.

提交回复
热议问题