1

We have a multi-core SOLR setup and each of the cores have different schemas.

Video core indexes video metadata Entity core indexes metadata of entities extracted from video title/description Vemap (video-entity mapping) core contains the mapping between entity and videos.

For the user entered query (ex: "president of the united states"),we will need to get results that match the video metadata directly OR videos that contain entities whose metadata matches the query.

The following query returns the results correctly.

http://<>/solr/video/select?q={!join from=id to=id fromIndex=vemap}{!join from=entityID to=entityID fromIndex=entity}etext:"president of the united states" OR "president of the united states"&wt=json&indent=true

But the below query which simply changes the order of OR query (B OR A instead of A OR B) throws syntax error.

http://<>/solr/video/select?q=(president of the united states) OR {!join from=id to=id fromIndex=vemap}{!join from=entityID to=entityID fromIndex=entity}etext:"president of the united states"&wt=json&indent=true

The error msg says

"error":{
    "msg":"org.apache.solr.search.SyntaxError: Cannot parse 'etext:\"president': Lexical error at line 1, column 17.  Encountered: <EOF> after : \"\\\"president\"",
    "code":400}}

The 2 queries differ only in the order of the OR query but only one of them returns results and the other throws syntax error. Am I missing anything here?

Is there a better way to construct the query to get the expected results?

4

0 回答 0