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

Support $text operator for full text search on index fields. #46

Closed
apersaud opened this issue Sep 21, 2018 · 0 comments
Closed

Support $text operator for full text search on index fields. #46

apersaud opened this issue Sep 21, 2018 · 0 comments
Assignees

Comments

@apersaud
Copy link
Member

Support for full text search starting with Parse-Server 2.5.0: For efficient search capabilities use the $text operator. By creating indexes on one or more columns your strings are turned into tokens for full text search functionality.

The format {"$text": {"$search": {parameters}}}

Parameter Use
$term Specify a field to search (Required)
$language Determines the list of stop words and the rules for tokenizer.
$caseSensitive Enable or disable case sensitive search.
$diacriticSensitive Enable or disable diacritic sensitive search

From the documentation:

# Finds strings that contains "Daddy"
curl -X GET \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -G \
  --data-urlencode 'where={"name":{"$text":{"$search":{"$term":"Daddy"}}}}' \
  https://api.parse.com/1/classes/BarbecueSauce
# Finds strings that contains "Daddy" ordered by relevance
curl -X GET \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -G \
  --data-urlencode 'where={"name":{"$text":{"$search":{"$term":"Daddy"}}}}' \
  --data-urlencode 'order="$score"' \
  --data-urlencode 'key="$score"' \
  https://api.parse.com/1/classes/BarbecueSauce

https://docs.parseplatform.org/rest/guide/#queries-on-string-values

@apersaud apersaud self-assigned this Sep 22, 2018
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