Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [search]

Looking for specific data to be found in a large data structure, a database, or a stream of data. For database queries with well identified search criteria, use the query tag.

1
vote
1answer
42 views

Hashing tag list to perform faster search

I have a list of items. Each item have various properties. Each item can be tagged, like tagging a post here. Right now, tags are represented using a Tags property, that is a string and it looks like ...
0
votes
1answer
116 views

How fuzzy search is implemented for file paths

Say I have file paths like this: my/long/directory/structure/index.js my/long/directory/structure2/index.js my/long/directory/structure3/index.js my/long/directory/structure.../index.js my/long/...
1
vote
0answers
30 views

KNN Implementation in production for a retrieval arquitecture (CBIR)

We are going to start the implementation of a Content-based image retrieval (CBIR) that It will be integrated in our main product. We did tests and proof of concepts with different libraries that ...
4
votes
1answer
111 views

Design point for product search and auto-complete using Elastic search?

I need to implement product search using Elastic search similar to it is done on any scalable ecommerce site.I am planning below algorithm for this Whenever product is added to system, First add it ...
1
vote
0answers
41 views

Giving search on customizable fields

I have some user defined custom fields corresponding to a ticket (A ticket is an entity which has subject, status and custom fields). I need to search tickets based on its custom field values. A ...
17
votes
6answers
3k views

Foreach-loop with break/return vs. while-loop with explicit invariant and post-condition

This is the most popular way (it seems to me) of checking if a value is in an array: for (int x : array) { if (x == value) return true; } return false; However, in a book I’ve ...
1
vote
2answers
100 views

Define a complex query in JSON sensibly

A bit of background. We are in the design phase of an HTTP API, and we are facing the question of how to define complex queries in JSON format. We have a items in our product that have A LOT of fields ...
2
votes
1answer
109 views

Data Structure for “Intuitive” Text Matching

I've noticed that text editors and such have a more-than-prefix/suffix-based pattern matching algorithm going on behind the scenes. And StackOverflow's tag matching algorithm does more than just ...
2
votes
1answer
61 views

Algorithm: Binary Search / Tree / Partitioning on unsortable data?

First, this question is not really about binary search as I neither have sorted data, nor any sortable data at all. :-) W.r.t the "unsortable" claim see below; but I think the title term "unsortable"...
-3
votes
1answer
119 views

Design the cache and search feature like hotel booking?

I need to design the feature like in encommerce(consider hotel booking site) we can enter the keyword/partial-keyword and need to return the relevant results. For Example :- If site admin or hotel ...
0
votes
0answers
27 views

Techniques for guiding users to correctly tag items?

I'm working on implementing a user defined tag system for my marketplace application's search system. Items can be anything so I can't know before hand what the tags will be, but I need to create ...
3
votes
1answer
100 views

What is the better search system, user defined tags or pre defined attribute fields?

I'm developing a marketplace application that will eventually list a large number of different types of items. Currently our search system (powered by Algolia) is built on pre defined attribute ...
1
vote
1answer
212 views

Data layer Abstraction from Business layer for search

This is regarding designing a search api. We have 3 tier architecture now using Spring MVC. All communications are via REST api. UI <-> Business <-> Data(sql). Now to implement faster ...
2
votes
3answers
136 views

Find the least words that will use all given letters

With a list of thousands of words and a small list of letters I am trying to find the least amount of words to make use of all given letters, assuming my dictionary of words covers all letters. The ...
0
votes
1answer
678 views

An elegant way to detect the end of an asynchronous recursive file search?

Given a recursive subroutine in single threaded environment which starts numerous asynchronous I/O operations and registers callback functions for each of them. This callbacks will be called on the ...
3
votes
1answer
661 views

Best method for Pattern Matching on Binary String?

I need to search a long string of binary string data (couple of megabytes worth of binary digits) for patterns of binary digits. There are about 100 000 different patterns to search for. Each is a ...
5
votes
2answers
234 views

Better to send all data to client or query server for every search?

I have a search function on my site that needs to search through ~2000 items (this table never changes, it will always have the same number of items) stored in MySQL. All it needs to do is search by ...
1
vote
4answers
236 views

Optimize non-trivial searches in vector of object pointers that share base class

I have an array that contains over 150,000+ object pointers of over 300+ different classes, but they all inherit from the same base class. Obviously that's very inefficient when we need to search for ...
0
votes
3answers
195 views

Strategy to update search index after fixing index generation

Describing the situation I'm working on an application (based on the Spring Framework) using a search index (lucene if that matters) to make content of that application searchable. Documents are ...
7
votes
1answer
3k views

Search across data cross several microservices

I have data for a certain domain distributed between a microservice and a legacy database. I have a search which spans fields on both legacy and microservice database. Previously (before microservice ...
1
vote
1answer
130 views

binary search vs search with data samples

As long as I remember at least in older versions of Cassandra database, search was implemented in following way - During startup several samples are collected from sorted table and when data is ...
0
votes
1answer
132 views

load more and Search Logic

Firstly i hope im in the right place to ask this question. I am building a web page that allows the user to select one image from a set of a 100+. i want to display them 6 at a time and the user ...
1
vote
3answers
235 views

Saving user searches to a database

My job is to come up with an implementation to save searches linked to an individual user, as well as the ability to analyze this data for business cases. The data will be used for users to see their ...
1
vote
3answers
375 views

Which data structure is best for an auto complete drop down that learns?

I made an auto complete text box for an application I'm working on. The text box basically has an associated list that it searches each time you enter something in the box. If you enter something ...
1
vote
2answers
70 views

Search page design with logical operators

I have a page that displays a set of records. The page has filter section to search records. currently the logical operator AND is applied between all the filter conditions. Now the requirement for ...
3
votes
4answers
92 views

Is a lookup key a property?

This is sparked by this where an OP did not want to add a string he was using for a key lookup because he did not consider it property of the class. To me the fact you are using it a for a lookup ...
3
votes
3answers
150 views

How to search up and down a graph from central point?

I have a set of nodes arranged like the below image. Left columns are parents, right columns are children. A line denotes ancestor/descendant. When I select a node, I want to find the immediate ...
4
votes
1answer
211 views

Caching data in a Rails variable instead of querying the database?

I have a list of about 15000 items in my database, every one of them has a unique ID and name. New items are added regularly but usually not more than ten a day. My frontend uses a form with ...
2
votes
1answer
121 views

How to architecture and expose an API for creating custom data filters?

This question is in the context of a server application - an API that feeds data to its clients. Here is the obvious: if I have some data, I can search and filter on that data however I please. Let's ...
1
vote
0answers
69 views

Where does search query logic go? Database or Service code?

I have a finished Chinese-English dictionary website as a personal project and it works pretty great. I'm using node/Express with node-dirty, which is a barebones file-based JSON database that loads ...
3
votes
3answers
113 views

SQL reverse filtering system

Sorry for the non-descriptive title, I don't know how to explain what I'm trying to achieve succinctly. In most SQL use-cases, we have records in the database that have properties, and we are trying ...
1
vote
2answers
108 views

What will be an efficient way to retrieve info OnKeyUp search from a web page?

I am very new to the software industry. I was assigned to implement keyup search or real time search for a web page. I need to search employee code. For example, employee code is like TM-00001. If ...
3
votes
2answers
202 views

Storing user search terms

I have php application like airbnb. I want to store search values each time user search for listings. my number 1 solution would be storing it in mysql table, but I'm not sure its wise to do, if site ...
1
vote
0answers
264 views

Minimum cost perfect matching (Using General graph)

This is a continuation of the problem described in this topic: Optimized algorithm to match entities together based on heuristics. I've come a little closer as to what might be the best solution. I'...
1
vote
1answer
215 views

Optimized algorithm to match entities together based on heuristics

I've encountered a problem which I think is rather suited to be solved using a Constraint Satisfaction Problem algorithm. I am however, not entirely certain that this is the best approach, as the ...
5
votes
3answers
677 views

How would you go about making a search algorithm for a CRM?

I know this question is kind of broad, but all I really need is some best-practice code structure or a link to a good tutorial. I am working on a CRM that runs on php and mysql. Currently, our search ...
0
votes
2answers
155 views

Searching, storing, and finding graph attributes and vertices

I've been reading the 3rd edition of [Algorithms][1] by Cormen, Leiserson, Rivest and Stein. For DFS and BFS their algorithm loops through all the vertices first and colors them white. 1) If the ...
0
votes
1answer
112 views

How does color search engine work?

From what I understand first you need to find the dominant colors in the images and store them inside a database. There's a script called "color thief" that does that beautifully. But chances are all ...
0
votes
1answer
257 views

Algorithm to find the highest Tetromino in a Tetris board?

Lets say that our Tetris board is represented as a 2D array of zeros and ones, where a 0 means empty and 1 means occupied, and you where asked to find the highest row in which a tetromino exists. ...
0
votes
3answers
140 views

Designing a simple web search engine: how to address the need to search for exact phrases?

I'm strongly considering a web search engine for my next pet project. All the basic principles are clear, but some details are not. Namely, I can't find a neat way to search by exact match, e. g. "The ...
1
vote
1answer
765 views

Classifieds categorization best practices and concepts

Im writting a web-page in Ruby on Rails , so i can learn the language and framework better. I have a User model which has_many Classifieds models which has_many Photos which accept_attachment :image. ...
10
votes
1answer
930 views

Partial name matching in millions of records

We have developed a web based application for name matching. It operates by breaking names into parts and the Soundex value of each part is stored in a database. The Levenshtein distance metric is ...
7
votes
1answer
1k views

A filtering logic should be in a repository or in a service?

I'm wondering the following: suppose we are building a system where there needs to be some filtering functionality to search for some entity. For example, one might want to apply the filtering to a ...
0
votes
1answer
102 views

Best Azure Solution for Complex Search Index

I need to perform quick searches against a combination of tags while including date ranges: Example: Users who have requested notifications who did not respond to a notification sent at least 3 ...
4
votes
1answer
151 views

Efficient Value-Lookup in List of k-Tuples

I've encountered a problem in a personal project that I think could be solved by a particular data structure but I'm not sure what. The problem is as follows: Given a set of k-tuples, provide an ...
0
votes
1answer
66 views

Search list items from other list, better way?

Today I have to search items of list from another list individually. I am just thinking about some better approach. Below is scenario described. Lets say I have two arrays, arr1 having 100 elements (...
1
vote
2answers
84 views

Place X items in N matrices without repeat column and row

I have N matrices (n × m) and items to place in each one (n · m). The same items are repeated randomly for each matrix. When one item is placed in (i, j), for the following matrices the ...
3
votes
2answers
854 views

Most efficient strategy for search large text areas for multiple values

I have a requirement for a service that does the following. Take a block of text and identify the server names in it (by name or ip address). So given: Lorem ipsum dolor sit amet, consectetur ...
0
votes
2answers
215 views

Check if list has a list of values

I have been trying to figure out an efficient algorithm that can check if a list of values contains a list of values. Both lists are sorted in ascending order. For example: Check if var ...
1
vote
1answer
55 views

Extract the main entity from a body of text for text categorisation?

I'm trying to categorise products based on various fields of data. I've had some success just matching search terms in the product names, but this naive approach doesn't work when it comes to larger ...