Umbraco 7.2 RC Searching Custom Field in List View
Hi All,
I just updated an in progress website to 7.2 RC. I was hoping to take advantage of some of the updates to the ListView that have been made. However after adding in the some custom fields into the table I was hoping that I would be able to search by those custom feilds but unfortunatly not, is this something that I need to turn on somewhere or is this not possible and perhaps should be made as a feature request?
I did read that blog post, I take it then that it should just be enabled by default. I have found that I am not able to access the search under the list view node. The only search i can access is on the list view itself and this does not seem to search within the custom fields, unless perhaps i need to reset my examin indexes?. There is no expand arrow on my list view document type. I wonder if my update did not work properly.
Ok...not sure that rebuilding the indexes will fix this though but it's worth the try.
Also try clearing the backoffice cache by deleting the /app_data/TEMP/ClientDependency files and increment the version attribute in /config/ClientDependency.config and see if it makes any change.
Hmm no luck so far. Whenever i search on the list view (i still dont get a search option under the node) it only searches on the node name, not any of the custom propertys i have added to the table.
I believe that's the case actually - see here. I contributed a little to this feature and remembered having a look at this... but not for very long, too hard for me I'm afraid :-) At least with trying to do it as a database query as the content service currently uses. The search here should perhaps be using Examine rather than a database query, in which case it would be easier to do searches on custom fields - but not sure how unpublished nodes should be handled then, so it's probably not that straightforward.
I was facing the same issue, I solved it by doing the following,
I downloaded the umbraco cms source code 7.2.4.
Added a new field called "search" in cmsDocument table. This field will contain the values of the custom fields.
Add the bold text to Umbraco.Core.Persistence.Repositories.ContentRepository class, GetPagedResultsByQuery() method,
sbWhere.Append(" OR (cmsDocument." + SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName("search") + " LIKE @" + args.Count + ")");
Should be just after line no: 730.
Build the Umbraco.Core project and copy the bll to umbraco bin folder.
Only other thing to do is, when Save and publish, register an event so that you could save the values in to Search field.
Hope this will work, it worked for me. now i can search using custom fields.
Umbraco 7.2 RC Searching Custom Field in List View
Hi All,
I just updated an in progress website to 7.2 RC. I was hoping to take advantage of some of the updates to the ListView that have been made. However after adding in the some custom fields into the table I was hoping that I would be able to search by those custom feilds but unfortunatly not, is this something that I need to turn on somewhere or is this not possible and perhaps should be made as a feature request?
Cheers
L
Hi Lachlann
It should be supported - You can read more about how it works in this blogpost about the beta http://umbraco.com/follow-us/blog-archive/2014/10/28/umbraco-720-beta-out-now
Hope this helps.
/Jan
Thanks Jan,
I did read that blog post, I take it then that it should just be enabled by default. I have found that I am not able to access the search under the list view node. The only search i can access is on the list view itself and this does not seem to search within the custom fields, unless perhaps i need to reset my examin indexes?. There is no expand arrow on my list view document type. I wonder if my update did not work properly.
Thanks for your help.
L
Hi Lachlann
Ok...not sure that rebuilding the indexes will fix this though but it's worth the try.
Also try clearing the backoffice cache by deleting the /app_data/TEMP/ClientDependency files and increment the version attribute in /config/ClientDependency.config and see if it makes any change.
Does that help any?
/Jan
Hmm no luck so far. Whenever i search on the list view (i still dont get a search option under the node) it only searches on the node name, not any of the custom propertys i have added to the table.
hmmm i wil keep looking.
L
Hi Lachlann
Do you see any errors in the console log of your browser? Or do you see any related info in the tracelog in /app_data/logs ?
If not then I suspect it might be a bug.
/Jan
I believe that's the case actually - see here. I contributed a little to this feature and remembered having a look at this... but not for very long, too hard for me I'm afraid :-) At least with trying to do it as a database query as the content service currently uses. The search here should perhaps be using Examine rather than a database query, in which case it would be easier to do searches on custom fields - but not sure how unpublished nodes should be handled then, so it's probably not that straightforward.
Andy
Ahh okay thanks Andy. So the gist is that custom searching on fields isnt quite ready yet? Thanks for help and input guys.
L
I was facing the same issue, I solved it by doing the following,
I downloaded the umbraco cms source code 7.2.4. Added a new field called "search" in cmsDocument table. This field will contain the values of the custom fields. Add the bold text to Umbraco.Core.Persistence.Repositories.ContentRepository class, GetPagedResultsByQuery() method, sbWhere.Append(" OR (cmsDocument." + SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName("search") + " LIKE @" + args.Count + ")"); Should be just after line no: 730.
Build the Umbraco.Core project and copy the bll to umbraco bin folder. Only other thing to do is, when Save and publish, register an event so that you could save the values in to Search field.
Hope this will work, it worked for me. now i can search using custom fields.
Cheers
Shiraz
Does it work in the latest version? Is it in core?
Hi,
Any news on this issue? Looks like in the latest version it doesn't work as well
is working on a reply...