A
A
Alexey selftrips.ru2017-12-10 08:58:53
MongoDB
Alexey selftrips.ru, 2017-12-10 08:58:53

Rating system for individual parts of pages/posts?

I would like to tie to individual places on the page (the page tells about several places in one city).
But all the solutions that I could find either rank the whole page/post or individual comments.
Can anyone suggest a solution for individual parts of the page?
For example for headers or attachments?
Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
h88p, 2019-09-27
@nezzard

Isn't it easier in this case to find all occurrences of "garr" and then just sort the result so that first there are only garr, and then everything else?

let a = ['Гарри йцу', 'Кто такой Гарри?', 'А что хочет Гарри?', 'Гарри угу', 'Гарри и кто такой этот ДЖС', 'Шо?'];
a.sort((w,e) => (/^Гарри/gi.test(w) ? -1 : 1)) //  ["Гарри и кто такой этот ДЖС", "Гарри угу", "Гарри йцу", "Кто такой Гарри?", "А что хочет Гарри?", "Шо?"]

E
Eugene, 2019-09-27
@Nc_Soft

https://docs.mongodb.com/manual/text-search/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question