uprtcl / js-uprtcl-server

Uprtcl JS web-server service provider

Home Page:http://uprtcl.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve search by under and linksTo feature.

sotous opened this issue · comments

Implement array recognition for both under and linksTo parameter inside searchOptions. This will enable the backend to understand the client requests at a complete and more complicated search.

Back end request reception should be aimed at the following interface:


export declare enum Join {
  inner = "INNER_JOIN",
  full = "FULL_JOIN"
}

export interface JoinElement {
  id: string;
  negation?: boolean;
}

export interface SearchOptionsJoin {
  type?: Join.inner | Join.full;
  elements: JoinElement[];
}

export interface SearchOptions {
  under?: SearchOptionsJoin;
  linksTo?: SearchOptionsJoin;
  text?: {
      value: string;
      levels?: number;
  };
  orderBy?: string;
  pagination?: {
      first: number;
      offset: number;
  };
}

Discussion about how to properly approach the INNER_JOIN logic in this case through dgraph inersections.

https://discuss.dgraph.io/t/finding-the-intersection-of-many-edges-from-node-a-within-node-b/13363

The above interface needs to be implemented in https://github.com/uprtcl/js-uprtcl