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
7
votes
2 answers

How to search in reverse order using String or StringBuilder in Java?

Can you please tell me how to search in reveres order (backward search) in Java? I need to do same for searching in HTML file as text.
Ashish TheCool
  • 71
  • 1
  • 1
  • 2
7
votes
2 answers

Unsequenced std::find, and std::any_of by value

Say I have an std::vector and want to know if it contains a 3 or get the iterator to the 3. I do not want to use an std::set or std::multiset for whatever reason. I would like to do this in std::execution::par_unseq mode. The two options I…
7
votes
6 answers

PostgreSQL - tree organization

I'm working on a project wich requires a tree of categories, organized as id, parent, title table. Which are the best ways to retrieve category and its subcategories(and a full tree, if root categories have parent=0) in Postgres? I'm looking for a…
Anton
  • 3,006
  • 3
  • 26
  • 37
7
votes
1 answer

Google Custom Search on submit

I would like to customize my search form. I am using Google Search Service and have it linked to my domain and so on. I chose the two column layout in the Control Panel, but however, I want to do something onSubmit of the form. So I tried to put an…
Richard
  • 1,543
  • 3
  • 25
  • 49
7
votes
2 answers

Django-filter ForeignKey related Model filtering

I've been struggling with dajngo-filter recently. I have 2 models: Book and Author. class Book(models.Model): title = models.CharField(max_length=150) author = models.ForeignKey(Author, on_delete=model.CASCADE) length =…
zorka5
  • 105
  • 1
  • 9
7
votes
2 answers

Delete data older than 10 days in elasticsearch

I am new to elasticsearch and I want to delete documents in my elasticsearch index which are older than 10 days. I want to keep only last 10 days of data.So is there any way to delete last 11nth day index automatically. What I have tried.. DELETE…
Kavya
  • 101
  • 1
  • 2
  • 8
7
votes
3 answers

How to open all .txt and .log files in the current directory, search, and print the file the search was found

I'm trying to search for a string in all text and log files in the current directory. And if it finds a match, print the text or log file where the match was found. Is this possible, and how can I manipulate the code below to accomplish this task? …
suffa
  • 3,606
  • 8
  • 46
  • 66
7
votes
1 answer

jqGrid Filtering Records

It seems there have been a few questions here regarding this subject, and they have some great answers, but it seems that my case is a little different. I need to filter the records displayed in a jqGrid, but entirely client-side. For a number of…
David
  • 208,112
  • 36
  • 198
  • 279
7
votes
0 answers

Folium Search Plugin No Results for FeatureGroup

I'm trying to add search functionality to a map I'm generating in Python with Folium. I see there is a handy Search plugin available and able to implement it successfully and get it added to the map. Unfortunately, using a FeatureGroup as the layer…
Shaun
  • 81
  • 5
7
votes
3 answers

"Users" sending GET requests to a website, when POST is expected

I keep seeing weird behaviour in our logs, where URLs that should normally only be accessed via a POST request are called via GET. The URLs include ones that are only ever constructed via javascript, so you wouldn't expect a regular spider to come…
Jonathan del Strother
  • 2,552
  • 19
  • 32
7
votes
1 answer

How do I write a custom search provider for Windows Explorer search UI

I am working on a Windows Explorer Namespace Extension which is a virtual filesystem. With regards to this, I would like to support search from the search dialog available in Windows Explorer. Currently I'm able to search by name in the folder I'm…
tronda
  • 3,902
  • 4
  • 33
  • 55
7
votes
3 answers

Bing: search - match only exact literal strings?

I'm using PHP and the Bing API to search for certain domainnames. I want only the results that are an EXACT match. Somehow Bing returns results that do not match exactly. When I search for : "www.gebouw.nl" I sometimes also get results like …
Dylan
  • 9,129
  • 20
  • 96
  • 153
7
votes
1 answer

Implementing Google's hashbang/Ajax crawl with ASP.NET MVC?

What are best practices for implementing Google's hashbang/Ajax crawl pattern with ASP.NET MVC? http://code.google.com/web/ajaxcrawling/docs/getting-started.html: the crawler will modify each AJAX URL such…
Oskar Austegard
  • 4,599
  • 4
  • 36
  • 50
7
votes
4 answers

LINQ to Entities Searching text properties for multiple keywords

For a website I'm doing we're using LINQ to Entities. I have been charged with adding search functionality to the site. I'm trying to figure out the most elegant way to search for multiple keywords (user entered) on a single field in the database.…
Darko
  • 38,310
  • 15
  • 80
  • 107
7
votes
1 answer

Google search YouTube iframe errors

Some pages of my site contain youtube videos and recently I noticed they were shown with bad description. To be exact it only shows: Your browser does not currently recognize any of the video formats available. Click here to visit our frequently…
Gag Er
  • 71
  • 2