search

Count number of occurrences of a pattern in a file (even on same line)

When searching for number of occurrences of a string in a file, I generally use: grep pattern file | wc -l However, this only finds one occurrence per line, because of the way grep works. How can I search for the number of times a string appears in a file, regardless of whether they are on the same or different lines? Also, what if I...

Drupal using Solr externally on another machine?

I'd like to use the Drupal solr search module with the Apache Solr Search hosted on an external machine. I know that Acquia offer this as a service. But it's not an affordable option for me. I'd like to install Solr on an inexpensive VPS and have all my various Drupal sites which are on different hosts accessing the search functions. Am ...

Keyword search on all columns of multiple tables in SQL Server

Dear all, We are maintaining the profile information’s (like profile first name, last name, address, city, state, age, religion, occupation, education, etc….) from tbl_profie table in SQL Server. The users can search profiles using any keywords like Example 1: MBBS, Delhi, India Example 2: MBA, Delhi, cricket Example 3 : London, Hindu...

database splitting; multiple tables

I am coding a classifieds ad web app. What is the optimal way to structure the database for this? Because of the high repeatability, would it be faster (in terms of searching/indexing) to have a separate table in the database for each city? Or would it be okay to just have one table for every city (it would have a lot of rows..). Th...

Glob() filesearch, question

Hi, a little question. I have this code, which is works perfect for files, but If am trying search on a directory name, the result is blank. How I can fix that? <?php function listdirs($dir,$search) { static $alldirs = array(); $dirs = glob($dir."*"); foreach ($dirs as $d){ if(is_file($d)){ $filename = pa...

How do you design a database to allow fast multicolumn searching?

I am creating a real estate search from RETS data using MySQL, but this is a general question. When you have a variety of columns that you would like the user to be able to filter their search result by, how do you optimize this? For example, http://www.charlestonrealestateguide.com/listings.php has 16 or so optional filters. Granted, ...

does WSS 3.0 search index document libraries?

Hi, I have a document library with a few files in it and I've noticed that doing a search for files in the document library (even the exact file name) does not seem to give any search results. The search does seem to provide results of terms within lists (such as Project Tasks) thought. Does Sharepoint Services 3.0 index files within d...

Image/"most resembling pixel" search optimization?

The situation: Let's say I have an image A, say, 512x512 pixels, and image B, 5x5 or 7x7 pixels. Both images are 24bit rgb, and B have 1bit alpha mask (so each pixel is either completely transparent or completely solid). I need to find within image A a pixel which (with its' neighbors) most closely resembles image B, OR the pixel that...

Input Search Layout Broken in IE6 and input img src not displaying

Yes, another stupid IE6 problem. Unfortunately i cannot turn a blind-eye to this one. The input button is not showing up in IE6 but is working in all other browsers and the layout is breaking as well. Any advice would be greatly greatly appreciated to see the problem online - please visit: http://chickenofthesea.com/company.aspx - ag...

searching a list of tuples in python

So I have a list of tuple like: [(1,"juca"),(22,"james"),(53,"xuxa"),(44,"delicia")] I want this list for a tuple whose number value is equal to something. So that if I do search(53) it will return 2 Is is an easy way to do that? ...

How to get position of last letter in a string in php?

Example of a string: "Some text.....!!!!!!!!?????" Using PHP how would I get the position of the last letter (or even alphanum character) which in this example is the letter t? ...

Windows Search Server Express

Is there a .Net api to run queries on Windows Search Server Express 2008? ...

Mysql optimization question - How to apply AND logic in search and limit on results in one query?

This is a little long but I have provided all the database structures and queries so that you can run it immediately and help me. Run the following queries:- CREATE TABLE IF NOT EXISTS `Tutor_Details` ( `id_tutor` int(10) NOT NULL auto_increment, `firstname` varchar(100) NOT NULL default '', `surname` varchar(155) NOT NULL default '', ...

What is faster when looking in lists of strings? "In" or "index"?

Hello! I have a bunch of lists of strings and I need to know if an string is in any of them so I have to look for the string in the first list, if not found, in the second, if not found, in the third... and so on. My question is: What is faster? if (string in stringList1): return True else: if (string in stringList2): ...

Rolling up search result counts to a parent category

Note: I'm having a hard time explaining this, so please ask questions and I'll try to refine the problem as much as possible. Assuming I have the following category structure: - Planets - Earth - Mars And the following items/categories (nevermind that some of them don't logically make sense): - Item #1 - Category: Planet -...

How to do a proper search with nhibernate

Hello everyone, i'm working on a small project that is supposed to allow basic searches of the database. Currently i'm using nhibernate for the database interaction. In the database i have 2 tables: Person and Address. The Person table has a many-to-one relationship with Address. The code i've come up with for doing searches is: publi...

help with making a multiple from search bring back data in SPLUNK

i cant seem to get splunk to coorporate with me, ive formed the xml but can't seem to get any search results, here is the xml code <form> <label>My Search Engine</label> <searchTemplate>"$SearchHere$" | head 250</searchTemplate> <earliestTime>-30d</earliestTime> <latestTime>-0d</latestTime> <html> Enter a sourcetype in the field ...

Are there libraries or techniques for collecting and weighing keywords from a block of text?

I have a field in my database that can contain large blocks of text. I need to make this searchable but don't have the ability to use full text searching. Instead, on update, I want my business layer to process the block of text and extract keywords from it which I can save as searchable metadata. Ideally, these keywords could then be...

How do I search a Perl array for a matching string?

What is the smartest way of searching through an array of strings for a matching string in Perl? One caveat, I would like the search to be case-insensitive so "aAa" would be in ("aaa","bbb") ...

SphinxSearch or a spider - which one to choose?

Hello, here is my problem: We own SiteA and SiteB and they share the same server and database where we have full control. SiteC , siteD and siteE are some of the sites we own as well but reside on a different web hosts. The goal is to create a unified search functionality for all of the sites mentioned above. That is if somebody search...