Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-47309

Ability to add multiple arrays in flex index

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • Morpheus
    • 7.1.0
    • fts
    • None
    • 1

    Description

      N1fty supports flex index in ARRAYs.

      INSERT INTO default VALUES ("airline_002", {"airline":"AF","airlineid":"airline_002","destinationairport":"SJC","distance":481.617376098415,"equipment":"320","id":2, "sourceairport":"LAX", "schedule":[{"day":0,"flight":"AF198","utc":"10:13:00"}, {"day":1,"flight":"AF250","utc":"12:59:00"}, {"day":2,"flight":"AF223","utc":"19:41:00"}], 
      "special_flights" : [ {"flight" : "AF444", "utc" : "4:44:44"}, {"flight" : "AF333", "utc" : "3:33:33"} ] });
       
      SELECT META(d).id
      FROM default AS d
      WHERE d.airline = "AF"
            AND ANY s, sf IN d.schedule, d.special_flights SATISFIES s.day > 1 AND sf.flight = "AF444" END;
      

      See if the following use can be added.
      If you look ANY clause has two arrays, two binding variables. both uses same position of array

      This same as  
      for i = 0; i < length(schedule) && i < length(special_flights); i++ ) {
              s = schedule[i]
              sf = special_flights[i]
      }
      

      As FTS doesn't know position of element that is fine, let N1QL handle during evaluation. As far as FTS search is concern treat them separate any clause sargable.
      If Index has either special_flights or schedule or both it should able to do.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            abhinav Abhi Dangeti
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty