parse-community / parse-community/parse-server

Full text search and sort by $score but need to have all columns of the class in the result

Open
#6,136 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

For simple class, I can sort the query result by select the columns i want like below

const q = new Parse.Query('City').fullText('CityNameEN', newKeyword).select(
            'CityNameEN',
            'CityNameCN',
            'State',
            'CountryNameCN',
            'CountryNameEN',
            'objectId',
            '$score'
          )
            .ascending('$score');

but the problem now is when I want to deal with a complex class that have many columns that include array, object, pointer type. I found that it is quite hard to select all what I need.

Is it possible that I can select all and also the @score so that I can sort ascending with the $score? thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Parse.Query fullText, select, and ascending calls shown in the issue, then trace how selecting fields interacts with the $score sort value. Check the query behavior for classes containing arrays, objects, and pointers. Done means a query can return all class fields while retaining $score for sorting.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.