Closed gtalarico closed 7 years ago
yeaaaaaaaaaa!
Implementation idea:
https://github.com/gtalarico/revitapidocs/blob/master/app/utils.py#L83
pass raw query instead "processed_query" to search_db()
while looping, add a re.match (flag ignore case) to check if an exact match is found. Add those to beggining of list instead of appending.
On front/js side, when creating DOM elements, check if query matches heading, if it does, apply a css class that will make those items stand out at the top
Ensure there is not significant performance decrease by running the search benchmark test before and after https://github.com/gtalarico/revitapidocs/blob/master/tests/benchmark.py
Implemented ongit fff3918a05bff5cbe3131bc1bab08c9cee00b2f1 and 9f12bc80279362dd89ad719335f42c7dc1030376
Exact match is raise and "bold" http://www.revitapidocs.com/2015/?query=Wall%20Class#searchModal
YEAAAAA!
Nice man! So helpful :D
On Thu, Feb 9, 2017 at 9:28 PM, Gui Talarico notifications@github.com wrote:
Exact match is raise and "bold"
[image: image] https://cloud.githubusercontent.com/assets/9513968/22811743/b517be84-ef0e-11e6-91dc-8c6505adccd4.png
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gtalarico/revitapidocs/issues/76#issuecomment-278840674, or mute the thread https://github.com/notifications/unsubscribe-auth/APGhajaGS9Oq2VWyGsbpZ_C4hvbMlhqIks5ra8tbgaJpZM4L8Xdu .
--
WeWork | Brian Lee Buildings Research Product Strategy R&D
wework.com http://www.wework.com/
Create Your Life's Work
If a user search
Wall Class
search will returnFace Wall
StructuralWall
and many others that include the wordsWall
andClass
.The entry that matches the query 100%, perhaps should be given a higher priority and pushed to the top. (especially considering the query might have been assisted by autocomplete, it means there is a high chance that the exact match is what the user was looking for.