Google App Engine Search API give certain fields more priority over others

Saad Attieh

Just investigating the abilities of Google App Engine and very interested in its search api. I love how you can define different fields to be automatically tokenised and sort the search results in different ways.

My question is can you have the results sorted in a way such that certain fields get more priority then others?

Example:

A document with two fields, title and body. It would be if search queries that matched titles were more highly ranked than querys that match the body.

Is this possible?

Cheers

Andrei Volgin

Unfortunately, it's not possible at the moment. From the documentation:

By default, search returns its results by descending rank. Also by default, the Search API sets the rank of each document to seconds since Jan 1st 2011. This results in the freshest documents being returned first. However, if you don’t need documents to be sorted by the time they were added, you can use rank for other purposes. Suppose you have a real estate application. What customers want most is sorting by price. For an efficient default sort, you could set the rank to the house price.

If you need multiple sort orders such as price low-to-high and price high-to-low, you can create a separate index for each order. One index would have rank = price and the other rank = MAXINT-price (since rank must be positive).

In your use case, you can retrieve documents that have a match in their title in one query, and then retrieve documents with a match in their body in a second query. Obviously, you can specify different rules (or even a set of rules), e.g.:

  • if the first query returns more than X results, do not do the second query
  • retrieve the first 20 documents by title, and if the date of the last document is less than A, retrieve the first 10 documents by body
  • retrieve the best 15 documents by title and add the best 5 documents by body

and so on. The rules, of course, depend on your domain and the way you try to prioritize (rank) the documents.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Google App Engine Search API

From Dev

Search API on Google App Engine

From Dev

Search API on Google App Engine

From Dev

How to get all the values of multiple fields with the same name in a search document in the Google App Engine search api?

From Dev

Google App engine Search API Cursor not not updating

From Dev

Accessing Google App Engine's Search API from PHP

From Dev

Accessing Google App Engine's Search API from PHP

From Dev

Putting large number of documents: Google App Engine and Search API

From Dev

How can I give more weight to some outputs over others in a neural net?

From Dev

Google App engine renaming fields in ndb datastore

From Dev

Google App Engine Java API

From Dev

Google CSE (Custom Search Engine) different search button and fields?

From Dev

Android Make a new Async task have priority over others in background or Dropbox Core API issue

From Dev

How to do view N more comments with Google App Engine Python API

From Dev

Search for existing Users in Google App Engine

From Dev

Google App Engine Search for Go: How to paginate?

From Dev

Google App Engine communicate with Compute Engine over internal network

From Dev

google app engine cron backend java always give an error

From Dev

Google App Engine and Google Calendar API

From Dev

Google Prediction API with Google App Engine

From Dev

Give document fields different priority in ElasticSearch

From Dev

Hide Search Engine ID for Google Custom Search Element API 2.0

From Dev

Google App Engine Api and Endpoints versioning

From Dev

Remote API with Google App Engine service accounts?

From Dev

error 204 in a Google App Engine API in java

From Dev

Google App Engine Channel API with custom domains

From Dev

Python API issue with Google App Engine

From Dev

REST API in Google App Engine + Python?

From Dev

Google app engine API: Running large tasks

Related Related

  1. 1

    Google App Engine Search API

  2. 2

    Search API on Google App Engine

  3. 3

    Search API on Google App Engine

  4. 4

    How to get all the values of multiple fields with the same name in a search document in the Google App Engine search api?

  5. 5

    Google App engine Search API Cursor not not updating

  6. 6

    Accessing Google App Engine's Search API from PHP

  7. 7

    Accessing Google App Engine's Search API from PHP

  8. 8

    Putting large number of documents: Google App Engine and Search API

  9. 9

    How can I give more weight to some outputs over others in a neural net?

  10. 10

    Google App engine renaming fields in ndb datastore

  11. 11

    Google App Engine Java API

  12. 12

    Google CSE (Custom Search Engine) different search button and fields?

  13. 13

    Android Make a new Async task have priority over others in background or Dropbox Core API issue

  14. 14

    How to do view N more comments with Google App Engine Python API

  15. 15

    Search for existing Users in Google App Engine

  16. 16

    Google App Engine Search for Go: How to paginate?

  17. 17

    Google App Engine communicate with Compute Engine over internal network

  18. 18

    google app engine cron backend java always give an error

  19. 19

    Google App Engine and Google Calendar API

  20. 20

    Google Prediction API with Google App Engine

  21. 21

    Give document fields different priority in ElasticSearch

  22. 22

    Hide Search Engine ID for Google Custom Search Element API 2.0

  23. 23

    Google App Engine Api and Endpoints versioning

  24. 24

    Remote API with Google App Engine service accounts?

  25. 25

    error 204 in a Google App Engine API in java

  26. 26

    Google App Engine Channel API with custom domains

  27. 27

    Python API issue with Google App Engine

  28. 28

    REST API in Google App Engine + Python?

  29. 29

    Google app engine API: Running large tasks

HotTag

Archive