Exclude Alias From All Poll
Myself and Maurice (the mind behind the Grails searchable plugin) are having an interesting discussion if Compass should, by default, include the alias in the all property.
Currently Compass includes the alias in the all property. And in version 2.0, one can configure if it should be excluded globally or on a per class mapping.
So, I am asking you Compass users, what do you think? Should it be included by default or not?
[Update:] Here is a short example of what I describe here:
Lets assume you have the following POJO:
1 2 3 4 5 6 | @Searchable(alias = "customer") public class Customer { // ... customer properties } |
When alias is not excluded from the all property, then a search for customer will return all the customers. If it is excluded, then a search for customer will not return anything (assuming that you don’t have the token customer on any other property).
March 4th, 2008 at 1:14 am
Shay, do you think you could give me a simple example? I didn’t get it.
March 4th, 2008 at 3:16 pm
I would prefer to have it excluded because the alias is meta data and by default i would expect to be searching just the data. Also, as long as I can use “alias:customer” one still has all the control in an intuitive way. If alias is included in the all property it’s less intuitive to separate the data from the meta data (”customer -alias:customer” ?)
March 6th, 2008 at 12:21 am
Shay, I would prefer every alias to be excluded from the all search by default.
I like software that does just the minimum on out-of-the-box, but can be configured to do a variety of things depending on the need.
March 10th, 2008 at 6:57 am
I prefer the alias not to be included in the all property because it causes a few issues:
1) Anything that matches “customer” is returned even when you are not searching for customer. This leaves users guessing/confused because their queries are returning unexpected results.
2)Highlighting makes the issue more visible when the only term highlighted is the alias and you were not searching for it.
If the alias is included in the “all” field you are forcing compass users to spend time debugging an issue that is very visible. You can included by default make the documentation for this feature requires clear details about the configuration and behavior.
April 3rd, 2008 at 1:55 am
[…] asked a while back if Compass should include the alias within the all field or not. Here is the question and the decision was to remove it. After getting some emails and based on some recent forum posts, […]