relevance search in Solr

你离开我真会死。 提交于 2020-02-02 14:35:08

问题


I am using DSE5.0.2 version and Solr ( integrated with dse) . I have to do relevance search using solr on the below tables/ data .

I have a table in cassandra on which we have created a solr core -

CREATE TABLE fullsearch (
    launchedtime bigint,
    hashtag text,
    solr_query text,
    PRIMARY KEY (launchedtime))

Now we have created a solr core and searching on the field hashtag . but i want those result which contains max no of hashtag i am searching . for ex : - if data in cassandra is -

launchedtime   hashtag    solr_query

1234567        a,b,c        Null

1234568        a,d          Null

1234569        a,c          Null

and I want to search all the hash tags that contains either a or c then mine solr query for searching is

cqlsh:keyspace> select * FROM fullsearch  WHERE solr_query='{"q":"hashtag:(a OR c)"}' ;

Then I want result that

1 and 2 row to occur first and then the third row . i.e Result

a,b,c

a,c

a,d

回答1:


After much re-search and from communicating with DSE - Support people , I came up with the below solution , please click the link to follow : -

https://blog.knoldus.com/2016/12/13/solr-relevance-search-using-solrj-in-scala/

I used the DSE SolrJ API to communicate to solr instead of directly querying it with Cassandra cql .



来源:https://stackoverflow.com/questions/41015743/relevance-search-in-solr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!