Solr没有显示电子商务数据的准确结果

时间:2019-12-11 14:34:03

标签: solr

我正在尝试将Apache Solr集成到电子商务数据中。搜索存在问题,无法显示准确的结果。这是针对“ Apple iPhone 11 128GB(PTA批准)”的搜索结果

{
  "responseHeader":{
    "status":0,
    "QTime":4,
    "params":{
      "q":"Apple iPhone 11 128GB (PTA Approved)",
      "df":"product_name",
      "fl":"product_name, score"}},
  "response":{"numFound":560,"start":0,"maxScore":2.3723078,"docs":[
      {
        "product_name":"Apple iPhone XR 128GB Black - PTA Complaint",
        "score":2.3723078},
      {
        "product_name":"Apple | iPhone 11 - 128GB",
        "score":2.2690601}
    ]
  }}

我认为搜索引擎会忽略(iPhone 11 )关键字,并赋予 PTA 更高的优先级。因此,我尝试对PTA关键字进行否定提升,结果显示效果很好。

{
  "responseHeader":{
    "status":0,
    "QTime":3,
    "params":{
      "q":"Apple iPhone 11 128GB (PTA Approved)",
      "defType":"edismax",
      "df":"product_name",
      "fl":"product_name, score",
      "stopwords":"true",
      "bq":"(*:* -PTA)^0.4"}},
  "response":{"numFound":560,"start":0,"maxScore":2.6690602,"docs":[
      {
        "product_name":"Apple | iPhone 11 - 128GB",
        "score":2.6690602},
      {
        "product_name":"Apple iPhone XR 128GB Black - PTA Complaint",
        "score":2.3723078}
]
  }}

我认为如果每个查询都传递PTA负值提升会很好,但是当我在搜索字词中添加颜色时,它仍然不起作用。 Apple iPhone 11 128GB黑色(PTA批准)

{
  "responseHeader":{
    "status":0,
    "QTime":6,
    "params":{
      "q":"Apple iPhone 11 128GB Black (PTA Approved)",
      "defType":"edismax",
      "df":"product_name",
      "fl":"product_name, score",
      "stopwords":"true",
      "bq":"(*:* -PTA)^0.4"}},
  "response":{"numFound":560,"start":0,"maxScore":3.6262395,"docs":[
      {
        "product_name":"Apple iPhone XR 128GB Black - PTA Complaint",
        "score":3.6262395},
      {
        "product_name":"Apple | iPhone 11 - 128GB",
        "score":2.6690602}
      ]
  }}

现在,我无法为数千种颜色添加负片。有人可以建议我一种更好的方法来获得准确的结果吗?

请注意,我在 product_name 字段中使用StandardTokenizerFactory。我还删除了重复结果,以简化结果。谢谢

0 个答案:

没有答案