Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

search function for the repository is too limited #6956


User avatar
0
TimMackey created

When searching the repository for "customize" 53 results are returned. When searching for "theme" 165 results are returned. When searching for "customize theme" 1 result is returned: this one. When searching for the above 2 words in reverse order, 0 results are returned. How can I search the respository for the existence of words, instead only for an exact match phrase?


11 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    If you are searching for code, it is recommended that you clone the code locally and search it. This allows you to use the editor's search function (including regular search, etc.).

    Please refer to the github documentation for the issue and PR search features: https://help.github.com/en/categories/searching-for-information-on-github

  • User Avatar
    0
    TimMackey created

    i'm not searching for code. I'm searching for discussions and possible solutions. I seem to have mis-identified my search target, which is this support forum/blog or whatever you call this collection of thousands of questions and discussions. I'm referring the the search control on the main page. How can I search this forum for the existence of words anywhere in the discussions, instead only for an exact match phrase?

  • User Avatar
    0
    maliming created
    Support Team

    The current filtering logic is: Question.Text.Contains(filter) || Question.Title.Contains(filter)

    I think we can improve it so that it supports searching for relevant content in the answer.

    But the logic may still be: Contains (filter), unless full-text indexing (such as elasticsearch) is used.

  • User Avatar
    0
    TimMackey created

    Here's a suggestion:

                string questiontitle = "abc def ghi jkl mno";
                string questiontext = "ab cd ef gh ij kl mn op";
                string filter = "kl ghi";
    
                int found_count = 0;
                string[] split_filter = filter.Split(" ");
                for (int idx = 0; idx < split_filter.Length; idx++)
                {
                    if (questiontext.Contains(split_filter[idx])
                     || questiontitle.Contains(split_filter[idx]))
                    {
                        found_count++;
                        continue;
                    }
                    else
                    {
                        break;
                    }
                }
                if (found_count == split_filter.Length)
                {
                    // all filter terms found
                }
                else
                {
                    // all filter terms NOT found
                }
    

    The code has not been tested. It's offered to convey a concept. In this example the filter terms are found across Text and Title. Another search method might be to search for "all filter terms in Text" || "all filter terms in Title".

  • User Avatar
    0
    maliming created
    Support Team

    We have started the investigation and I will inform you if there is any progress.

  • User Avatar
    0
    TimMackey created

    When will this be fixed? Still unable conduct meaningful searches that don't return less than 100's of hits.

  • User Avatar
    0
    maliming created
    Support Team

    hi @timmackey I will evaluate if it can be implemented as soon as possible. : )

  • User Avatar
    0
    TimMackey created

    @maliming - When will this be fixed? You ought to be able to insert the code I suggested (above) in 5 minutes, and close this report. What is the blocking issue that prevents progress with a dead simple solution in hand?

  • User Avatar
    0
    maliming created
    Support Team

    hi timmackey

    Sorry, I have already started, but recently I have been doing other work. I don't have much experience in deploying and maintaining ES, so I am still studying it and try to get online as early as possible.

    This feature is also very helpful for us.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @timmackey

    We will work on this but unfortunately it might take a few monts more. I know it is a bad workaround but could you use Google search if you can't find what you are looking for:

  • User Avatar
    0
    alper created
    Support Team

    hi @tim I know the search is very basic. We'll improve it. Searchin' with the T-SQL is very slow and not feasible. Maybe we can add Full Text Search functionality. For now could you pls search on google using the site: attribute.