我们有一个多核SOLR设置,每个核心都有不同的模式。
视频核心索引视频元数据 实体核心索引从视频标题/描述中提取的实体的元数据 Vemap(视频 - 实体映射)核心包含实体和视频之间的映射。
对于用户输入的查询(例如:“美国总统”),我们需要直接获得与视频元数据匹配的结果或包含元数据与查询匹配的实体的视频。
以下查询正确返回结果。
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
但是下面的查询只是改变OR查询的顺序(B OR A而不是A OR B)会引发语法错误。
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
错误消息msg说
"error":{
"msg":"org.apache.solr.search.SyntaxError: Cannot parse 'etext:\"president': Lexical error at line 1, column 17. Encountered: <EOF> after : \"\\\"president\"",
"code":400}}
2个查询仅在OR查询的顺序上有所不同,但只有一个返回结果而另一个抛出语法错误。我在这里错过了什么吗?
有没有更好的方法来构建查询以获得预期的结果?