Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Driscoll 6 posts 76 karma points
    17 days ago
    Mike Driscoll
    0

    Search Umbraco Form Responses

    This may be a simple question, but I have not found a solution in these forums yet...

    I see that after configuring Umbraco Forms, a search index was created called UmbracoFormsRecordIndex. I already have a search working that seems to be using the "ExternalIndex" (this came with my UnSkinned theme). Where in the templates/code/configuration can I look to change it so it searches against the UmbracoFormsRecordIndex rather than the ExternalIndex?

    Thanks! md

  • Alex Skrypnyk 5960 posts 22668 karma points MVP 4x admin c-trib
    17 days ago
    Alex Skrypnyk
    0

    Hi Mike

    What search do you want to use UmbracoFormsRecordIndex?

    Is it a custom search or search in the Umbraco backend?

    If it's a custom one you can easily use the needed index.

    Thanks,

    Alex

  • Mike Driscoll 6 posts 76 karma points
    15 days ago
    Mike Driscoll
    0

    I believe it would be a custom search? The theme I installed has a search on the front end that currently uses the ExternalIndex to search page content. I would like to override that search and return results from the UmbracoFormsRecordIndex.

    I found the partial view that seems to control the results, and found this line:

    ExamineManager.Instance.TryGetIndex(Constants.UmbracoIndexes.ExternalIndexName, out IIndex index)

    Would it be as simple as swapping out that ExternalIndexName with the form's index? I guess I can't find where the Constants are coming from.

    Thanks! md

  • Mike Driscoll 6 posts 76 karma points
    1 week ago
    Mike Driscoll
    0

    I think I'm on the right track, but I n eed to figure out what "Category" needs to be passed in to the CreateQuery method. "Content" works for the ExternalIndex, but it must be something else for form results.

    Here is some of my code:

    if (!String.IsNullOrEmpty(searchTerm) && ExamineManager.Instance.TryGetIndex("UmbracoFormsRecordsIndex", out IIndex index))
            {
                var searcher = index.GetSearcher();
    
                var criteria = searcher.CreateQuery("content", BooleanOperation.And) ...
    
Please Sign in or register to post replies

Write your reply to:

Draft