Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArangoSearch unable to retrieve offset info for nested fields #19494

Open
etiennecl opened this issue Jul 31, 2023 · 0 comments
Open

ArangoSearch unable to retrieve offset info for nested fields #19494

etiennecl opened this issue Jul 31, 2023 · 0 comments

Comments

@etiennecl
Copy link

etiennecl commented Jul 31, 2023

My Environment

  • ArangoDB Version: 3.11.1
  • Deployment Mode: Single Server
  • Deployment Strategy: ArangoDB Starter in Docker
  • Configuration:
  • Infrastructure: Macbook Pro M1
  • Operating System: MacOS 12.6.5
  • Total RAM in your machine: 32Gb
  • Disks in use: SSD

Component, Query & Data

Affected feature: ArangoSearch OFFSET_INFO

AQL query (if applicable):

FOR doc IN `index`
    SEARCH doc.nested[? 
        FILTER CURRENT.key == 'gh' AND STARTS_WITH(CURRENT.value, 'montre') 
    ]
    LIMIT 100
    FOR offsetInfo IN OFFSET_INFO(doc, ['nested[*].value'])
        RETURN {
            name: offsetInfo.name,
            matches: offsetInfo.offsets[* RETURN {
                offset: CURRENT,
                match: SUBSTRING_BYTES(VALUE(doc, offsetInfo.name), CURRENT[0], CURRENT[1])
            }]
        }

Dataset:
All documents have the following shape

{
  "type": "abc",
  "nested": [
     {
       "key": "gh",
       "value": "montreal"
     },

     {
       "key": "yz",
       "value": "quebec"
     }
  ]
}

Steps to reproduce

  1. Create the following alias
{
    "name": "plain",
    "type": "norm",
    "features": [
        "frequency",
        "position",
        "offset",
        "norm"
    ],
    "properties": {
        "locale": "en",
        "case": "lower",
        "accent": false
    }
}
  1. Create the following inverted-index collection_a_index over collection collection_a
{
  "searchField": true,
  "trackListPositions": true,
  "fields": [
    {
      "name": "type",
      "analyzez": "plain"
    },
    {
       "name": "nested",
       "nested": [
         {
           "name": "key"
         },
         {
           "name": "value"
           "analyzer": "plain"
         }
       ]
    }
  ]
}
  1. Create the following search alias
{
  "type": "search-alias",
  "name": "index",
  "indexes": [
    {
      "collection": "collection_a",
      "index": "collection_a_index"
    }
  ]
}

Problem:

Getting the offset info for nested properties does not work.

Expected result:

I would expect arango to allow getting offset info when matching using nested search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant