简体   繁体   English

Solr块加入父查询解析器范围查询错误

[英]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.

相关问题 SOLR - 阻止加入父查询解析器变体的可能性 - SOLR - Block Join Parent Query parser variation possibility Solr:使用“块联接子级”查询解析器 - Solr: Using the Block Join Children Query Parser Solr-将“ Block Join”查询和父查询合并为“ OR” - Solr - Combine Block Join Query and parent query with “OR” Solr块联接子查询解析器具有与非父文档匹配的查询 - Solr Block Join Children Query Parser with query that matches non Parent Docs Solr Query通过join搜索子文档和父文档 - Solr Query to search child and parent documents by join Solr搜索嵌套在父元素的所有子元素中的嵌套查询,块联接。 - Solr search in the nested all childs of the parent element, Nested Query, Block join. Solr-具有许多子约束的块联接父查询 - Solr - Block join Parent query with many Children constraints 块联接查询解析器-需要基于子项或父项或两者中的匹配项来获取子文档 - block join query parser - need to fetch child document based on match either in child or in parent or in both 在solr中使用edismax查询解析器在不同字段上使用不同的搜索词 - Different search term on different fields using edismax query parser in solr Solr的多面日期范围查询时出错 - Error on a Faceted Date Range Query for Solr
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM