簡體   English   中英

如何 select ArangoSearch-從特定鏈接查看字段

[英]How to select ArangoSearch-View field from a specific link

鑒於以下ArangoSearch View定義, collections col_personcol_hotel都有一個命名字段f_name

{
  "cleanupIntervalStep": 2,
  "writebufferSizeMax": 33554432,
  "commitIntervalMsec": 1000,
  "id": "291316",
  "consolidationPolicy": {
    "type": "tier",
    "segmentsBytesFloor": 2097152,
    "segmentsBytesMax": 5368709120,
    "segmentsMax": 10,
    "segmentsMin": 1,
    "minScore": 0
  },
  "consolidationIntervalMsec": 1000,
  "globallyUniqueId": "h506F923AD141/291316",
  "links": {
    "col_person": {
      "analyzers": [],
      "fields": {
        "f_name": {
          "analyzers": [
            "arabic_text_analyzer",
            "arabic_collation_analyzer",
            "identity",
            "text_en"
          ]
        }
      },
      "includeAllFields": false,
      "storeValues": "none",
      "trackListPositions": false
    },
    "col_hotel": {
      "analyzers": [],
      "fields": {
        "f_name": {
          "analyzers": [
            "arabic_text_analyzer",
            "arabic_collation_analyzer",
            "text_en",
            "identity"
          ]
        }
      },
      "includeAllFields": false,
      "storeValues": "none",
      "trackListPositions": false
    }
  },
  "writebufferIdle": 64,
  "primarySort": [],
  "primarySortCompression": "lz4",
  "writebufferActive": 0,
  "storedValues": [],
  "type": "arangosearch"
}

問題是,在執行以下 AQL 查詢時,ArangoDB 會在兩個集合的f_name中進行搜索,因此如何只在col_person.f_name中搜索,而不是在兩個集合中進行搜索。

LET QR1 = (
    FOR doc_asview_global1 IN asview_global1
    SEARCH
    ANALYZER(
        Like(doc_asview_global1.f_name, "%Regional%"),"identity") OR
    ANALYZER(
        LEVENSHTEIN_MATCH(doc_asview_global1.f_name, "Regional",1,true),"arabic_text_analyzer") OR
    ANALYZER(
        PHRASE(doc_asview_global1.f_name, "Regional"), "arabic_text_analyzer")
    LIMIT 10000
    SORT BM25(doc_asview_global1) DESC
    RETURN doc_asview_global1
)

RETURN QR1

您可以在SEARCH操作中添加OPTIONS以指定您感興趣的 collections:

SEARCH
  ...
  OPTIONS { collections: ["col_person"] }

https://www.arangodb.com/docs/stable/aql/operations-search.html#search-options

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM