[英]Solr Block Join Parent Query Parser range query search error
I am using Solr 6.1.0, and I'm indexing Parent-Child data into Solr. 我正在使用Solr 6.1.0,并且正在将父子数据索引到Solr中。
When I do my query, I use the Block Join Parent Query Parser, to return only the parent's records, and not any of the child records, even though there might be a match in the child record. 当我执行查询时,即使子记录中可能有匹配项,我也使用“阻止联接父查询查询”仅返回父记录,而不返回任何子记录。
However, I am not able to do the range query for the child record. 但是,我无法对子记录进行范围查询。 For example, if I search with this query q= +title:join +{!parent which="content_type:parentDocument"}range_f:[2 TO 8]
例如,如果我使用此查询进行搜索,则q = + title:join + {!parent which =“ content_type:parentDocument”} range_f:[2 TO 8]
I will get the following error: 我将收到以下错误:
{
"responseHeader":{
"zkConnected":true,
"status":400,
"QTime":3},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.parser.ParseException"],
"msg":"org.apache.solr.search.SyntaxError: Cannot parse 'range_f:[2': Encountered \"<EOF>\" at line 1, column 18.\r\nWas expecting one of:\r\n \"TO\" ...\r\n <RANGE_QUOTED> ...\r\n <RANGE_GOOP> ...\r\n ",
"code":400}}
What could be the issue here? 这里可能是什么问题?
Regards, 问候,
Edwin 埃德温
Try with: 尝试:
q= +title:join +_query:"{!parent which=\\"content_type:parentDocument\\"}range_f:[2 TO 8]" q = + title:join + _query:“ {!parent which = \\” content_type:parentDocument \\“} range_f:[2 TO 8]”
You cannot have any spaces before the join query so this would work 联接查询之前不能有任何空格,因此可以正常工作
{!parent which="content_type:parentDocument"}range_f:[2 TO 8]
One way to get around this is to move the range query to the fq parameter instead of the q parameter. 解决此问题的一种方法是将范围查询移到fq参数而不是q参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.