Copied to clipboard

Flag this post as spam?

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


  • Dibs 129 posts 610 karma points
    1 week ago
    Dibs
    0

    Dear Umbraco Examine Experts

    Making use of FluentSearchAPI, the method .MultipleCharacterWildcard() works as expected in the code below, debugging displays the following value Query={+contentRTE:query*}

    var query = Request.QueryString["query"];
    
    var searcher = Examine.ExamineManager.Instance.SearchProviderCollection["CharlieSearcher"];
    var searchCriteria = searcher.CreateSearchCriteria();
    
    var searchQuery = searchCriteria.Field("contentRTE", query.MultipleCharacterWildcard()).Compile();
    
    var searchResults = searcher.Search(searchQuery);
        if (searchResults.Any())
        {
            <ul>
                @foreach (var result in searchResults)
                {
                    var node = Umbraco.TypedContent(result.Id);
                    <li>
                        <div class="row">
                            <a href="@node.Url"> @node.Name</a> 
                        </div>
                    </li>
                }
            </ul>
        }
        else
        {
            <p>No search results found for <strong>@query</strong></p>
        }
    

    When i make use of .SingleCharacterWildcard() in place of .MultipleCharacterWildcard() no results are found for the query search term. Debugging displays the following value Query={+contentRTE:qu?ry?}

    I am on the understanding i should see Query={+contentRTE:qu?ry} in debugging and see results for 'query' in my results.

    Am i missing something ?

    Dibs

Please Sign in or register to post replies

Write your reply to:

Draft