问题
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