omc / searchyll

GNU General Public License v3.0
48 stars 15 forks source link

Use URL as page id? #43

Open alranel opened 5 years ago

alranel commented 5 years ago

page.name is currently used for populating the id field:

https://github.com/omc/searchyll/blob/e601fea641979982d12e8210aea6699434b31840/lib/searchyll.rb#L40-L44

However, there's no guarantee that name contains a defined value, and Elasticsearch will complain if it doesn't.

Why don't we use page.url instead, which is unique enough for being used as an ID (definitely more than name) and is guaranteed to be always defined?