solr使用冒号在id上传输最短路径错误

jvlzgdj9  于 2021-10-10  发布在  Java
关注(0)|答案(1)|浏览(355)

我有下面的简单表达式 expr=shortestPath(core_data,from="https\://mycompany.com/id/ARMP/AM/GT/ST/CCS1/01/03/05/96/96",to="https\://mycompany.com/id/ARMP/AM/GT/ST/CCS1/01/03/IS/02",edge="id=link_ss",maxDepth="4") 这是一个错误。

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: --> http://172.22.0.28:8983/solr/core_data_shard2_replica_n2/:org.apache.solr.search.SyntaxError: Cannot parse 'id:([https://mycompany.com/id/STL/KG1/pk_67_4])': Encountered " "]" "] "" at line 1, column 49.
Was expecting:
    "TO" ...

    at org.apache.solr.client.solrj.io.graph.ShortestPathStream.open(ShortestPathStream.java:366)
    at org.apache.solr.client.solrj.io.stream.ExceptionStream.open(ExceptionStream.java:52)
    at org.apache.solr.handler.StreamHandler$TimerStream.open(StreamHandler.java:465)
    at org.apache.solr.client.solrj.io.stream.TupleStream.writeMap(TupleStream.java:79)
    at org.apache.solr.common.util.JsonTextWriter.writeMap(JsonTextWriter.java:164)
    at org.apache.solr.common.util.TextWriter.writeMap(TextWriter.java:216)
    at org.apache.solr.common.util.TextWriter.writeVal(TextWriter.java:69)
    at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:153)
    at org.apache.solr.common.util.JsonTextWriter.writeNamedListAsMapWithDups(JsonTextWriter.java:387)
    at org.apache.solr.common.util.JsonTextWriter.writeNamedList(JsonTextWriter.java:293)
    at org.apache.solr.response.JSONWriter.writeResponse(JSONWriter.java:73)
    at org.apache.solr.response.JSONResponseWriter.write(JSONResponseWriter.java:66)
    at org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:65)
    at org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:891)
    at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:584)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:415)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)

让我进一步解释一下:我使用的链接字段是 id (单值)和 link_ss (多值)。取决于我使用的顺序( id=link_sslink_ss=id )我犯了一个不同的错误。 Cannot parse 'link_ss:(https://mycomany.com/id/STL/KG1/pk_67_8/TS_67_8_5152_4 https://mycomany.com/id/STL/KG1/pk_67_4/TS_67_4_260_3 https://mycomany.com/id/STL/KG1/pk_67_4/TS_67_4_260_9) 或者上面的那个。但是请注意,解析错误已经包含与原始错误不同的ID。因此,当在图形中爬行时,错误确实发生在内部。上面的查询确实不起作用,但在id周围加上双引号会有所帮助,即。 link_ss:("https://mycomany.com/id/STL/KG1/pk_67_8/TS_67_8_5152_4") 行得通
谢谢

pgx2nnw8

pgx2nnw81#

我做了一些实验,似乎您必须在“from”字段中避开冒号(:),而不是在流式表达式的“to”字段中。只需在“发件人”字段中的冒号(:)前添加反斜杠即可,例如:

shortestPath(oana,from="http\://google.com",to="http://oana1.com",edge="link_from=link_to",maxDepth="1")

相关问题