Questions tagged [search]

Questions about search algorithm mechanics and implementation. *NOT* for questions about using search tools within an API (e.g. Google, Bing, Facebook).

Searching is one of the most common and important tasks in Computer Science.

The most basic search algorithm is a (also called "sequential search"). Each item in a collection of data is examined in sequence until the sought item is found.

If the collection in question has already been sorted, for instance, then a more efficient is possible.

Search can become more complex when, rather than finding one instance of a specific item, we want to find all items meeting a certain set of criteria. For instance a query can specify extremely complex search criteria, and much of relational database design involves the planning of an efficient way to perform those searches.

Another more complex search scenario is graph search, in which a series of nodes and edges must be traversed. Common algorithms for this domain include and . In many cases, a heuristic search algorithm such as can achieve more efficient results by making use of additional information about the problem.


Do not use this tag for questions about specific search tools within an API. Some more relevant tags for that would be the following:

37207 questions
8
votes
4 answers

WordPress search only works with posts, not pages

I'm working on my own custom WordPress theme, using a blank, default template to start. I haven't edited the search.php file. Many of my WordPress posts are Pages. Unfortunately, the site search only retrieves posts, not pages. Any idea how to get…
Ryan
  • 6,027
  • 16
  • 52
  • 89
8
votes
2 answers

search menu with result count per option

On various websites there is a search bar that already depicts the amount of results you will get per option you can select. In some cases there is a tenfold of options you can choose from and for each option you already see if you select this…
user1983507
8
votes
2 answers

How to fuzzy search single sqlite3 field

I have a bunch of rows in a basic CRUD app that I want to let the user search for by title. SQLite3 has a full-text search solution, but is it recommended to also use that for not-full-text searches, or is there a simpler way? For example,…
quadrupleslap
  • 460
  • 1
  • 6
  • 18
8
votes
0 answers

How to implement an autocorrect/alternative spelling search system with PHP and MySQL fulltext boolean mode for an MVP

NB: I could have used a dictionary like Pspell, Aspell or Hunspell but this case does not apply properly to business names or cities. Furthermore, I don't want to query the DB for all the suggested corrections (especially with a typeahead firing…
Mike Casan Ballester
  • 1,690
  • 19
  • 33
8
votes
2 answers

Github GraphQL Search with Filtering

Based on my limited searching, it seems GraphQL can only support equal filtering. So, Is it possible to do Github GraphQL searching with the filtering conditions of, stars > 10 forks > 3 total commit >= 5 total issues >= 1 open issues <= 60 size…
xpt
  • 20,363
  • 37
  • 127
  • 216
8
votes
1 answer

std::search on single-pass range

I'd like to read from a std::istream until a certain sequence of characters is found, i.e., I'd like to implement the following interface: void read_until (std::istream &is, std::string_view needle); Using std::istreambuf_iterator, I believe this…
levzettelin
  • 2,600
  • 19
  • 32
8
votes
3 answers

How to detect a typo in a product search and suggest possible corrections?

Given a very large database of product names, how would you detect possible typos in user searches and suggest possible corrections (Kinda like the way Google presents them)? E.g. User enters "fork handels" and presses 'search'. They get back "No…
izb
  • 50,101
  • 39
  • 117
  • 168
8
votes
2 answers

Are IDs guaranteed to be unique across indices in Elasticsearch 6+?

With mapping types being removed in Elasticsearch 6.0 I wonder if IDs of documents are guaranteed to be unique across indices? Say I have three indices, all with a "parent" field that contains an ID. Do I need to include which index the ID belongs…
Oskar Persson
  • 6,605
  • 15
  • 63
  • 124
8
votes
1 answer

Client-side predictive search relevance calculation with multiple parameters

I'm writting a predictive search that, for server performance requisites (all is cached), must be run on the client browser. The items are TV shows and movies and are matched by title, actors and directors names. Once the search has been executed,…
Coquevas
  • 609
  • 6
  • 11
8
votes
1 answer

Aggregate and filter from one index to another through a third

On my Elasticsearch server I have three indices: Person, Archive and Document. Each document has a archive field which is the _id of the Archive it is in. Each archive has a owner which is the _id of the Person that is the owner of the…
8
votes
2 answers

How to use WordPress REST API v2 to search posts?

I am writing Android application and I am using WordPress REST API v2 for communication with WordPress from my Android application. I have implemented Activity that lists all posts from single…
clzola
  • 1,925
  • 3
  • 30
  • 49
8
votes
0 answers

Visual Studio Code: Search on multiple terms

We are trying to figure out a way to search for all the files that contain multiple terms. For instance that reference the Orders file and then the status field. Searching for the status field alone does not work as orders have status, items have…
Larry Weidig
  • 141
  • 1
  • 7
8
votes
1 answer

Github Search: how to search in multiple languages

Github search supports: language:javascript But I want something like: language:javascript OR language:typescript So that I can sort them by stars or do other filters in a single search. The reason is: with typescript becomes…
GutenYe
  • 3,227
  • 2
  • 25
  • 21
8
votes
2 answers

Why would eclipse not show search results inside file in results list?

We have one installation of Eclipse which does not show the individual lines on which search results occur as do all other installations, as shown here: How can we turn on this feature so that individual results in each line are shown?
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
8
votes
3 answers

checking if word exists in a text file python

I'm working with Python, and I'm trying to find out if a word is in a text file. i am using this code but it always print the "word not found", i think there is some logical error in the condition, anyone please if you can correct this code: …
user8026631