Search Enhancements

The Sandman

Tazmanian Addict
Joined
Jan 1, 2004
Messages
29,165
We've just installed Daniel Hood's ElasticSearch Essentials. This brings two major improvements to TAZ's search functionality:
Search Bar Auto Complete

When you type in the search bar you'll see suggestions based on what you've typed so far. The terms come from phrases used in our search index rather than just common words. This means that it should work well for niche boards, any language, etc... This can really help reduce missed searches.

Suggestions/"Did You Mean" Functionality

There are two different "Did You Mean" features. One type is for even when you get results for your search but there is a more popular, similar, term in TAZ's search index. This can lead to better results. It also helps reduce typos. The other type is for when there are no results for your query -you will be presented with a list of similar terms that appear in the index.

Check it out and let us know what you think! :)
 

LeadCrow

Apocalypse Admin
Joined
Jun 29, 2008
Messages
6,818
Autocomplete seems to include suggestions for deleted content like spam (tried as a guest).
 

PacMan

Tazmanian
Joined
Apr 12, 2004
Messages
4,266
Any idea why when typing in "pacman" no suggestions comes up?
 

Digitalpoint

Brain
Joined
Aug 29, 2012
Messages
309
DigitalPoints search resource indexes all soft deleted posts. This is why they appear in the suggestions.
Well, that's a symptom of the issue at least. The issue itself is it's not doing any permission checking if something is viewable by the user doing the search. For example you can search for titles of threads in forums the searching user doesn't have access to.
 

Danielx64

Developer
Joined
Nov 8, 2009
Messages
3,300
So that mean that someone can sniff out topics in the staff forum?
 

Daniel Hood

XenForo Add-On Developer
Joined
Sep 23, 2013
Messages
299
I didn't get the notifications for being tagged in this thread. Odd.

Autocomplete seems to include suggestions for deleted content like spam (tried as a guest).

DigitalPoints search resource indexes all soft deleted posts. This is why they appear in the suggestions.

Yep... you can test it by finding a topic in an area that guests don't have access to and then searching for it as a guest.

I didn't really see this coming up when I did it. My thought was that permission checks might be too cumbersome for such a basic feature since it's only searching the content in the index, not the real database. I'm not sure how I want to handle this moving forward. It seems undesired but I'm not entirely sure if it's worth it to do the permission checking. (I don't mean worth it as far as worth programming, I mean worth executing the code one very call -- since this searches every keystroke the minor performance could add up plus it'd take away from the "instant" aspect).

So that mean that someone can sniff out topics in the staff forum?

Well, the thread titles, I suppose.

Any idea why when typing in "pacman" no suggestions comes up?
I assume that while it's a valid word, it's not in the index. This doesn't auto complete with known words, it autocompletes based off the words in the index. So if you made a thread called "pacman" and then tried, it'd show up (I might be limiting it to a minimum of x uses, I forget at the moment).
 

PacMan

Tazmanian
Joined
Apr 12, 2004
Messages
4,266
Any idea why when typing in "pacman" no suggestions comes up?

I assume that while it's a valid word, it's not in the index. This doesn't auto complete with known words, it autocompletes based off the words in the index. So if you made a thread called "pacman" and then tried, it'd show up (I might be limiting it to a minimum of x uses, I forget at the moment).


Its a valid word, "pacman" does show up in various threads, yet it does not showup in the suggestions. Try it for yourself.
 

Daniel Hood

XenForo Add-On Developer
Joined
Sep 23, 2013
Messages
299
Its a valid word, "pacman" does show up in various threads, yet it does not showup in the suggestions. Try it for yourself.
Check the box for search titles only, no results. I didn't do full post contents because the index size would increase + thread titles give a higher quality auto complete type set up (in my opinion -- I'm ok with discussing it though as I'm always open to suggestions for improving my products).
 

PacMan

Tazmanian
Joined
Apr 12, 2004
Messages
4,266
Check the box for search titles only, no results. I didn't do full post contents because the index size would increase + thread titles give a higher quality auto complete type set up (in my opinion -- I'm ok with discussing it though as I'm always open to suggestions for improving my products).

So it only does autocomplete on words in the title?

This thread has "pacman" in both the posts and title and it does not show up.

https://theadminzone.com/threads/google-maps-pacman.133073/
 

HWS

TAZ Member
Joined
Aug 21, 2012
Messages
206
I didn't really see this coming up when I did it. My thought was that permission checks might be too cumbersome for such a basic feature since it's only searching the content in the index, not the real database. I'm not sure how I want to handle this moving forward. It seems undesired but I'm not entirely sure if it's worth it to do the permission checking. (I don't mean worth it as far as worth programming, I mean worth executing the code one very call -- since this searches every keystroke the minor performance could add up plus it'd take away from the "instant" aspect).

Looks like there should be permission checking. The other possibility would be a flag in the index determing that it is a public thread title or not. If you do the later the "add to index" function would have to be extended.
 

Digitalpoint

Brain
Joined
Aug 29, 2012
Messages
309
You could do cached permission checking or something that lasts 5 minutes (or something), that way it doesn't need to redo it every request. Or another idea would be to not do permission checking against threads as they come up, but instead only pull thread titles that are in forums that are publicly available (the forum IDs of those forums is also something that could be cached).
 

Daniel Hood

XenForo Add-On Developer
Joined
Sep 23, 2013
Messages
299
I believe that the permission issue is resolved. There will be another version of this add-on soon that will improve results and address another bug but this one was higher priority so I pushed it out faster.
 
Top