search

php How to search files in a directory for an exact line match?

$allfiles = glob($searchdir."*.txt"); $elist = array(); foreach($allfiles as $file){ $lines = array_merge($elist, file($file, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES)); } foreach ($lines as $existing){ // this echos a number // echo "<br />Existing".$existing."<br />"; if (preg_match("/\b".$searchforthis."\b/i", $existi...

Search for a word in a file and replace it in C?

How could I search for a word in a certain file, and then replace that word with a different string of text. Like for example: In this paragraph find the word iPad and replace it with iPhone. I would like a code sample in C (or C++ if it is not possible without a third party library). ...

How can I make a Magento site wide search?

Okay. This is propably very basic and noobie, but I have about 20+ stores inside one Magento site. I want to make the default search not only search the current store, but all other stores that are in the systems aswell. Kinda like the global search in backend. The frontend search should search those 20+ sites which are under the same ...

Most Efficient way to 'look up' Keywords

Alright so I am writing a function as part of a lexical analyzer that 'looks up' or searches for a match with a keyword. My lexer catches all the obvious tokens such as single and multi character operators (+ - * / > < = == etc) (also comments and whitespace are already taken out) so I call a function after I've collected a stream of onl...

google search result URL error

In google search result URL is showing wrong that is https: rather than http: How to rectify this error? In yahoo and other search engine its showing right URL ...

Searching for information about the Go language

I was trying to look for information about generic database drivers for Google's Go language, when I notice I have hard time to get any result. Go SQL returns nothing related to the Go language, and golang SQL only returns useful results from the mailing list (and not, say, from github). Is there any smarter way I can look for informat...

Calculate the score only based on the documents have more occurance of term in lucene

Hi, I am started working on resume retrieval(document) component based on lucene.net engine. It works great, and it fetches the document and score it based on the the idea behind the VSM is the more times a query term appears in a document relative to the number of times the term appears in all the documents in the collectio...

How to index forum discussions for search?

For a discussion forum, does it work better to index each entry inside a discussion thread as a separate lucene document or simple concat all entries within a discussion into one big block of text and index a whole discussion thread as a single lucene document? ...

Searching Google's localized web search with Java

Hello, I am trying to use a Java App to search Google in different countries, i.e. google.co.uk, google.de, etc. I found that the Google Ajax API used with Java will only let you do web search with the following URL url = new URL( "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&amp;" + "q=information%20retrieval&ke...

Any way of "multiplying" MySql records to test a large db on server?

I have several mysql tables in a database. Currently I am doing finishing test on my website, and one is to test a heavy db to see how much this affects performance (searching). The website is a classifieds website. It would take a very long time for me to insert one classified at a time to reach a significant nr. So I wonder, is ther...

Vim search and highlighting control from a script

I'm writing a script in which I want to control searches programmatically, and get them highlighted. The search() function results are not highlighted (I think), so using that function is not of use to me. What I want to do is use the 'normal /' command to search for a variable, but that doesn't seem to be straightforward. I can scrip...

How to convert linear search to binary search?

- This is my find() method using Binary Search algorithm: It works just as you would expect it to. No problems at all. public int find(long searchKey) { int lowerBound = 0; int upperBound = nElems - 1; int currentIndex; while(true) { currentIndex = (lowerBound + upperBound) / 2; if(a[currentIndex] == searchKey) retu...

case insensitive search for file(s) with "string" somewhere in the filename linux

right now, all I know to use is: find / -name string.* that is case sensitive and it won't find files named: 1string.x STRing.x string1.x How can I search so that all the above would be returned in the search? ...

Building an SQL query using multiple (optional) search fields

Hi, I have a form that is going to be used to search through a table of support tickets. the user can search from a few difficult optional fields. Date (to/from) Ticket Status Engineer Ticket Contact I'm wondering what is the best way to deal with optional search filters. So I have a query that takes in parameters from the user. S...

how to implement search functionality on tableview in iphone

i have a tableview. i loaded the rules into the table of search view controller. when i type character into searchbar how to implement search functionality and how to add it to the rulesArray. i have an array 'rulesArray" with all rules like below. [rulesArray addObject:[rules objectAtIndex:k]]; Rule is a class. Also I want to add rul...

Simple Solr schema problem for autocomplete

I have a very simple SQL table that I want to import into Solr but because of the features I want for search I can't determine the best schema. The user will start typing into an input box and after 3 characters it will send the request to the server and pull out the most relevant results returning the top 15 matching id and name. Tab...

How can I can not find a user with spaces in their names?

I try to search user:"Nam Gi VU" But I got no results, how can I search using this name? (The name can be any names, I just get my name as an example. ...

how to implement color search with sphinx?

hello, searching a photo by dominant colors using mysql is quite simple. assuming that the r,g,b values of the most dominant colors of the photo is already stored in the database, this could be achieved for example by something like: SELECT * FROM colors WHERE ABS(dominant_r - :r) < :threshold AND ABS(dominant_g - :g) < :thresh...

Search weighted graph, lowest cost, remember route

Is there a rgaph searching algorithm that searches through a graph (from point a to point b, at the lowest cost possible - this is on a weighted graph) that remembers the path that it takes (e.g. not Dijkstra's as it does not remember the path but simply gives you the shortest distance)? ...

Good choice for functional structure for insert and search-

I need a data-structure, which supports the following operations both memory and time-efficient, it can be assumed, that the value has an ordering. Add a value to the structure Find out, whether a value is in the structure Plus, the structure has to be immutable, because I want to use Haskell. If I would not assume immutability, pro...