Open Closed

search function for the repository is too limited #6956


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)
  • 0
    maliming created

    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

  • 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? image.png

  • 0
    maliming created

    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.

  • 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".

  • 0
    maliming created

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

  • 0
    timmackey created

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

  • 0
    maliming created

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

  • 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?

  • 0
    maliming created

    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.

  • 0
    ismcagdas created

    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:

    image.png

  • 0
    alper created

    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.