SQL Server :: Weighted Keyword Search?

Oct 25, 2010

I am searching for products out of my database:
AND (CONTAINS(P.name,
@contains_key)
OR
CONTAINS(P.description,
@contains_key)
OR P.sku
like
'%'
+ @Keywords
+
'%')

As you can see I'm using the CONTAINS statement and searching against the name and description fields.I would like to give the results a weight (or score) based on how often the word shows up and in what field.Example:if the word shows up in the name field -- give it 2 points every time the words appears.if the word shows up in the description field -- give it 1 point every appearance.Then ORDER the query based on the Score. And, perhaps add a where clause that the Score > 1 or some value.I realize, I will probably have to re-write my query and this "point" system may not be possible, but I know there is a way to weight results, but can't find any help online. I would also assume, this would be done in temp tables and select statements and directly in the where clause.

View 2 Replies


Similar Messages:

AJAX :: Sql Search With Weighted Result?

Aug 4, 2010

Does anyone know how to do this? My boss wants to have an indexed sql server return a set of hits based on their weight in the db.

View 1 Replies

Web Forms :: Search Textbox With Search Keyword Inside?

Aug 23, 2010

how to make a search txtbox that includes the search keyword and when the user clicks the search keyword disappears

View 5 Replies

Setting Up A Keyword Search?

May 4, 2010

I would like to set up a keyword search with and/or wildcards which searches across a rather large tables with around 10,000 rows and growing.What would be the best to set this up ? I heard a lot about indexing etc, im using a SQL2005 DB.And I do not wish to purchase 3rd party software.

View 8 Replies

C# - Approaches To Do Keyword Search In FAQ

Oct 7, 2010

My site (ASP.NET + C#) has FAQ data pull from another site's web service in XML format. The data size is pretty small (just about 50 faqs). I want to implement a keyword search for the FAQ and highlight the search keyword. What could be a fast and easy approach to do this?

My first thought is just using a C# string search or any XML search method. I know this is not scalable. But consider the FAQ is little, it may not need to index the FAQ. I could be wrong.

View 1 Replies

DataSource Controls :: Keyword Search In Sql?

Feb 9, 2010

In one of my column have a comma separated list of keywords.I have to build a query that will return the matching rows whenever user enters the keyword.for ex.if my keywords are java,.net,sql,php,ajax then on search of java OR java,sql OR php,java should return the above row.

View 5 Replies

Web Forms :: How To Search The Database According To The Destination And Keyword

Mar 3, 2011

i have a sql server database which has a table name tourheader.in this there are some fields named as follows--Id, name, city, description, tourcode. on the page i have two text box destination and keyword. I want to search the database according to the destination and keyword. in the tourheader the fields contain description and keyword are name and city.

i have make aquery---- string queryString = "SELECT Id , name " + "FROM TourHeader WHERE name like'%" + key + "%'AND city like'%" + key + "%' AND city like'%" + destin + "%'AND name like'%" + destin + "%'";

but it doesnot work properly.

View 10 Replies

How To Bold Search Keyword In Description Of Result

Nov 13, 2010

i develope the search engine project

how to bold search key word in description of result

View 1 Replies

Yield Keyword Is Statement Keyword Or Contextual Keyword?

Mar 15, 2011

Is yield keyword is Statement keyword or Contextual Keyword?

Because in MSDN yield keyword is mentioned in both type of Keywords so i'm little bit confused in this.

View 2 Replies

How Can Search A Keyword From A Database(all The Tables) Using A Single Query

Oct 2, 2010

i am developing a web site in Asp.Net using Visual Studio 2008.i want to know that how can i search a keyword that will be entered by the user, i want the key word should be searched in complete database(all the tables)using a single query.I am using sql database. how can the keyword be searched using like parameter...

View 1 Replies

DataSource Controls :: Search Money Range Using Between Keyword

Apr 12, 2010

I have a search screen where there are total 15 search fileds...one among them is amount range (money datatype)...using Between keyword i am trying to filter the search results...problem is it is taking more time to fetch the records...if i comment only money range in where condition and all other remain same..then it is returning in 2 seconds for 25 records...otherwise it is taking around 31 seconds to return 25 records..

View 1 Replies

Forms Data Controls :: Highlight Search Keyword In C#.net?

May 22, 2010

anyone got a sample highlight the search keyword in gridview using c# .net?

View 2 Replies

Web Forms :: Build Search Engine Keyword Checker?

Jan 10, 2014

How to create a page which return ranking of keyword w.r.t it's site.

for e.g if i write www.aspforums.net 

and enter keyword asp.net

it should return ranking of this keyword for diff search engines

View 1 Replies

Making Search Operation On The Basis Of The Keyword Write In The Text Box

Jul 12, 2010

I wanna search operation on the basis of the keyword write in the text box and search the subsequent result from the database..

View 2 Replies

State Management :: Storing Search Keyword In Session Variable?

Oct 27, 2010

I have heard alot about sql injection and how it is normally caused. Mostly sql injection in my opinion is caused through search boxes. Now my question is quite simple. Is it advisable to store the search keyword in a session variable to prevent sql injection? I don't want to expose the keyword through the querystring as it is prone to attacks. So in short there is no harm in using session variables to store the keyword right?

View 6 Replies

Forms Data Controls :: Keyword Search To Display On GridView?

Jul 26, 2010

So, one of my end-users would like the option to search for a keyword and have all of the records that contain that keyword show up in a gridview. Is this possible? How would I do this? Are there tutorials somewhere?

View 9 Replies

Visual Studio :: Want To Do A Reverse 'search In All Files', So It Returns Files That Don't Contain "keyword?

May 6, 2010

I basically want to do a reverse 'search in all files', so it returns files that don't contain "keyword".Does anyone know how to do this, or the regex used, etc?

View 1 Replies

SQL Server :: Incorrect Syntax Near The Keyword 'else'?

Mar 26, 2011

I am unable to find out what's wrong in this stored procedure...it says Incorrect syntax near the keyword 'else'.

07/09/2010 WEGMANS #098 Q02 STATE COLLEGE PA
$5.96

07/12/2010 WAL-MART #1640 QPS STATE COLLEG PA
$21.07

You are sharing a picture (58.7 KB) with 2venkatesh

cutie.jpg 2venkatesh declined the offer 2venkatesh is busy. You are sharing a picture (107.4 KB) with 2venkatesh

151377447_1d4ec57c68.jpg 2venkatesh declined the offer.You are sharing a picture (58.7 KB) with 2venkatesh

cutie.jpg 2venkatesh declined the offer

2venkatesh who are you buddy in my gtalk? who are the people in those pics?

12860701286070128607012860701286070128607012860701286070128607012860701286070[code]...

View 2 Replies

SQL Server :: Setting Up The CASE Keyword In SQL From Web App?

Mar 7, 2011

I was wondering how I would go about setting up the CASE keyword in SQL from my Web app. I have a table where I need to update anywhere between 20 and 300 rows with different values. My table looks like this

ID EventID SeatType SeatCount Status Comments

On my page, these rows are listed in a table with a textarea to add comments. So when I click a button I need to update All the comments for all the users of a certain "EventID".I think my SQL Statement should go something Like this:

UPDATE Events
SET Comments =
CASE [code]....

Is that correct? I would be getting the ID and comment from each row of the table. Also (using C#) what would be the most efficient way to get this information into the query? I was thinking to use a for statement but I hear many string concatenations requires lots of processing?

[Code]....

View 7 Replies

SQL Server :: Both Keyword Using Joins In A Single Query?

Jul 29, 2010

Is it possible to have ON and WHERE , both keyword using Joins in a single query

View 6 Replies

SQL Server :: Incorrect Syntax Near The Keyword 'distinct'

Dec 8, 2010

I have the data below:

id locationid cookieid username IPAddress createdate
1 704 192.168.0.103 2010-12-08 18:11:24.423
2 704 192.168.0.103 2010-12-08 18:13:26.133
3 704 myname@hotmail.com 192.168.0.103 2010-12-08 18:13:47.710
4 704 myname@hotmail.com 192.168.0.103 2010-12-08 18:16:42.730
5 704 myname@hotmail.com 192.168.0.103 2010-12-08 18:17:00.433
6 704 myname@hotmail.com 192.168.0.103 2010-12-08 18:18:09.867
7 1504 myname@hotmail.com 192.168.0.103 2010-12-08 18:26:01.447

Now, I want to select all unique locationid's from a single username, its important that the results can be PAGED and SORTED, I now have:

SELECT * FROM (select ROW_NUMBER() OVER (ORDER BY createdate) as RowNum,
distinct(locationid), l.*
FROM location_views lv
INNER JOIN locations l on l.id=lv.locationid
where lv.username='myname@hotmail.com'
) as info
WHERE RowNum > 0 AND RowNum <= 100

But this throws the error: "Incorrect syntax near the keyword 'distinct'."

View 2 Replies

DataSource Controls :: Word Search In Sql Server Without Full Text Search On Particular Column?

Jan 27, 2010

I want a word search i doing the search like this , but it is giving character wherever there is in the string,if i give two character like ok it is searching for a full string where ever Ok is there select * from table1 where textfield like '%word%' this query would match word but also wordabc how can i make it aware of delimitions

View 3 Replies

SQL Server :: Minimum Search Engine - Add A Search Mechanism To The Site

Jan 19, 2011

I have a database filled with information about a bunch of different articles. I'm trying to add a search mechanisim to the site where you would type in what you are looking for, and it would search through the articles finding the most appropriate article. In my database I have a bunch of different fields that will help find the best article. For example, for each article, there is a title, description, category, a bunch of tags, Number of page views, number of votes, and the sum of all the vote scores. All this informaiton i believe can be used to gather the most relevent article based on the persons search terms. The problem is I don't know what to do with this information. What I would like to do is have a scoring system where the highest score is the first result and the lowest score is the last result. Where the first result is the most relevent.

So for example: The user types in "Korean War" it looks through all the articles, and gives all the articles with "Korean War" in the title + 1, all the tags with "Korean" or "War" + .1, then adds the number of views/1000, and then adds the average vote/4. (I just made that scoring system up on the spot, I would need to do some testing of course). Then it would sort the articles based upon the score it recieved. Is there anyway to do this with a select statement where I can run all of the calculations and then sort them with an "ORDER BY" command? Or would i have to have the server side code do the calculations store them in an array, and then sort them in the array? Or is there a better way of doing this that I might not know of (which is certainly possible).

View 3 Replies

DataSource Controls :: How To Parse Normal Search Text To Sql Server Full Text Search String

Feb 13, 2010

How i can make the normal search string to sql server full text search parse, because when we are user enyer search text "how to run windows schedule in C#", in database we have article to to this, but data not returning and sometime is say error in key word and etc.

View 1 Replies

SQL Server :: How To Save Pdf Files In Database And Create A Search Engine To Search For Pdf Files

Sep 28, 2010

in my project i would like to save pdf files in database, how to save pdf files in database ? along with that i would like to create create a search page to search for pdf files with PDF file names , how to accoplish these things

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved