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

Elasticsearch wildcard search on not_analyzed field

I have an index like following settings and mapping; { "settings":{ "index":{ "analysis":{ "analyzer":{ "analyzer_keyword":{ "tokenizer":"keyword", "filter":"lowercase" …
Hüseyin BABAL
  • 15,400
  • 4
  • 51
  • 73
8
votes
2 answers

VBA (Excel): Find Based on Multiple Search Criteria Without Looping

I have a large data sheet that I want to search in VBA based on 3 sets of criteria. Each row entry can be assumed to be unique. The format of the sheet/data itself cannot be changed due to requirements. (I've seen several posts on related questions…
user1205577
  • 2,388
  • 9
  • 35
  • 47
8
votes
3 answers

Search String By SubWords

What Kind of algorithms + data structures that would help me to do that? Having a file contains like 10000~ lines loaded in memory in a ordered set. With a given search string I want to be able to get all the lines that have words prefixed with…
ToddlerXxX
  • 91
  • 4
8
votes
1 answer

Creating custom search button in Notepad++

I am looking for a way to create custom buttons for Notepad++. So far I haven't been able to find solutions regarding this. The buttons would be doing a regular expression search and highlight the search results as well. This would make it much…
Endy
  • 83
  • 1
  • 3
8
votes
2 answers

Escaping special characters in wildcard search using Lucene.NET

I have looked for a long time for escaping special characters like #, {, , [, ], ... while in wildcard search in Lucene.NET 3.0.3.0, but I can´t find any possible solutions. I have index my documents using StandardAnalyzer. The field "title" has the…
user1723639
8
votes
2 answers

High-Performance Hierarchical Text Search

I'm now in the final stages of upgrading the hierarchy design in a major transactional system, and I have been staring for a while at this 150-line query (which I'll spare you all the tedium of reading) and thinking that there has got to be a better…
Aaronaught
  • 120,909
  • 25
  • 266
  • 342
8
votes
4 answers

Important data structures in search

I'm interested in teaching myself different data structures, something I currently know very little about. My plan is to implement a few key structures so I understand how they work. I'm looking for suggestions on important data structures to…
Tristan
  • 6,776
  • 5
  • 40
  • 63
8
votes
3 answers

Search sorted List for closest and less than

Consider some long called X and a sorted List. What is the most efficient algorithm to find the index or value in the List that is (i) less than X, and (ii) The closest to X on the number line (assuming condition (i) has been satsified)?…
user2763361
  • 3,789
  • 11
  • 45
  • 81
8
votes
2 answers

Data Structure to store Integer Range , Query the ranges and modify the ranges

We need to maintain mobileNumber and its location in memory. The challenge is that we have more than 5 million of users and storing the location for each user will be like hash map of 5 million records. To resolve this problem, we have to work on…
user2537119
  • 129
  • 3
  • 9
8
votes
1 answer

How to search in this tree?

I have a tree data structure in which parent node can have any number of child nodes(>=0). I want to create such tree. One of the possible approach thought by me is creating a linked list as shown in my_approach picture. Linked list are connected as…
Nikhil Chilwant
  • 629
  • 3
  • 11
  • 31
8
votes
1 answer

Using Tweepy to search for tweets with API 1.1

I've been trying to get tweepy to search for a sring without success for the past 3 hours. I keep getting replied it should use api 1.1. I thought that was implemented... because I can post with tweepy. What am I doing wrong? #!/usr/bin/env…
user2740993
  • 83
  • 1
  • 1
  • 3
8
votes
4 answers

Emacs search by exact regex match instead of partial

I'm looking through a very large hydrodynamics code in c which has, often, some very poor variables choices. Including a global variable named just 'g'. Similarly, there's a file with a variable named 'geom' and lots of other variables which…
DilithiumMatrix
  • 17,795
  • 22
  • 77
  • 119
8
votes
3 answers

Search in solr with special characters

I have a problem with a search with special characters in solr. My document has a field "title" and sometimes it can be like "Titanic - 1999" (it has the character "-"). When i try to search in solr with "-" i receive a 400 error. I've tried to…
shinjidev
  • 383
  • 1
  • 6
  • 21
8
votes
2 answers

Is there a fast way to do a '%phrase%' search in any DB?

I have a large dataset with 5M rows. One of the fields in the dataset is 'article_title', which I'd like to search in real-time for an autocomplete feature that I'm building on my site. I've been experimenting with MySQL and MongoDB as potential DB…
soulkphp
  • 3,753
  • 2
  • 17
  • 14
8
votes
6 answers

Best way to add full web search to my site?

I need to add full web search to my site. I need something like Google Custom Search but with no ads and it has to be free. Any recommendation of a web service or open source project that can index my site and allow me to search it will be…
sker
  • 17,842
  • 8
  • 37
  • 41