search

How to best deal with photos passed to IFilter?

I'm implementing an IFilter for indexing image formats. One problem is photos - many users have tons of photos, photos are huge and loading and searching for text on them is time consuming. Yes, sometimes people use cameras instead of scanners for digitizing documents, but the potential problems IMO far outweight the possibility of enco...

Search and Replace of text in a memorystream in C# .NET

I have loaded a memorystream with a word document and I want to be able to alter specific text within the memorystream and save it back to the word document, like search and replace functionality. Please can anyone help me with this as I don't want to use the Word Interop libraries. I have the code to load and save the document already...

Simple Database Viewer and Search Tool

I've exported all the old orders out of our old store into a mySQL DB. Anyone know of a simple project or web based app that will let you search all fields with a wildcard? So if I type in sha automatically any results with those letters would popup. This would be similar to dbman but with mysql and some ajax. And preferably free and...

Search for rails that does ranking of results according to field

Hello, I want to add search functionality to my Rails website. The search has to rank results according to relevancy. By this I mean if the search occurs in the post title it should be given higher score than post body and post comments. Also, it would be nice to rank a post higher if the phrase occurred more than once. I know that Sphi...

how to get autocomplete response in 100ms (milliseconds)

I am trying to build an auto-complete text box which will give results in about 100ms. I have checked Google with firebug it is 74ms, stackoverflow has 500ms. I am using drupal6 and it is taking 800ms for auto complete which is not useful at all. Can anybody suggest to me how I can build an auto-complete with a response time of under ...

Seach&Replace strings in PDF with perl/ruby/php

Hi! I'm looking for a way to script replacing strings in PDF documents. I can use either perl, ruby or php. If possible, regex would be a blast... Thank you! ...

How to perform search on MySQL table for a website.

How do I perform a search similar to that of Wikipedia on a MySQL table (or several tables at a time) without crawling the database first? (Search on wikipedia used to show you the relevancy in percentage). What I'm looking for here is how to determine relevancy of the results and sort them accordingly, especially in case where you pull...

Exact string match in vim? (Like 'regex-off' mode in less.)

In vim, I often want to search on a string with finicky characters which need escaping. Is there a way I can turn off the meaning of all special characters, kind of like regex-off mode in less, or fgrep? I am dealing with particularly hairy strings; here's an example: ((N/N)/(N/N))/N Not having to escape any characters to do a search...

Searching SQL Server

I've been asked to put together a search for one of our databases. The criteria is the user types into a search box, SQL then needs to split up all the words in the search and search for each of them across multiple fields (Probably 2 or 3), it then needs to weight the results for example the result where all the words appear will be th...

Algorithm that searches for related items based on common tags

Lets take StackOverflow questions as example. Each of them has multiple tags assigned. How to build an algorithm that would find related questions based on how many common tags they have (sorted by number of common tags)? For now I can't think about anything better than just selecting all questions that have at least one common tag into...

What is the fastest way to find all occurrences of a substring?

This is purely out of curiosity. I was browsing through an article comparing various string search algorithms and noticed they were all designed to find the first matching substring. This got me thinking... What if I wanted to find all occurrences of a substring? I'm sure I could create a loop that used a variant of KMP or BM and dumpe...

SQl Server 2008 FILESTREAM, Indexing Services, and FTS

I need to implement a service to search PDFs. Initially I started using SQL Server 2008 FTS, but soon realized that my PDFs would have to be stored in the DB itself. I was then pointed to Indexing Services as well as to the SQL 2008 FILESTREAM data type so that I can store PDFs in the file system. So how do these three (Indexing Servi...

How to find k nearest neighbors to the median of n distinct numbers in O(n) time?

I can use the median of medians selection algorithm to find the median in O(n). Also, I know that after the algorithm is done, all the elements to the left of the median are less that the median and all the elements to the right are greater than the median. But how do I find the k nearest neighbors to the median in O(n) time? If the med...

PHP & MySQL & forms -- flexible search? (ex: X ingredients can make Y recipes)

I'm just getting started with PHP/MySQL, so please forgive the rather simplistic question: As a practice example, I want to create a small dbase of recipes. Each recipe has X different ingredients. The table is simple enough I think - each row represents a recipe and each column after the first(primary key) is an ingredient with a TRUE/...

Drive searching

I am developing an application and I would like to be able to search the whole drive for a regular expression. I would prefer to do this in c# but I can call other languages. Is there any easy way to just seek through all the binary data on a drive from begining to end? ...

No results returned to a reader but the same query works thru SQL Management Studio

Hello, I'm experiencing weird behavior with some of full text search queries, especially those with multiple words. These are working fine when executed thru Management Studio but returning no results when called from a code. I did a SQL Trace to see what commands are being sent from my app and exactly same command come with results wh...

Better method to search array?

I have an array (nodes[][]) that contains values of effective distances that looks something like this: __ __ |1 0.4 3 | |0.4 1 0 | |3 3.2 1 ... | |0.8 4 5 | |0 0 1 | -- -- Where the first value, node[0][0] is the distance from node 0 to node ...

HD Regular Expression Search

I am working on a project for my computer security class and I have a couple questions. I had an idea to write a program that would search the whole hard drive looking for email addresses. I am just looking for addresses stored in plain text since it would be hard to find anything otherwise. I figured the best way to find addresses would...

how to design any tree(simple bst or avl or rb) which supports searching by both key and value???

suppose i have some data of type(key,value).how do i effeciently sort them so that i can find the key uising value and value using key? ...

Fast algorithm to check membership of a pair of numbers in large (x,y) coordinates in Perl

I have a list of sorted coordinates (let's call it xycord.txt) that looks like this: chr1 10003486 10043713 chr1 10003507 10043106 chr2 10003486 10043713 chr2 10003507 10043162 chr2 10003532 10042759 In reality the this file is very2 large with 10^7 lines. What I want to do is given a...