Search Facility Using Asp.net/sql Server
Oct 26, 2007
Hi,
I am currently developing a real estate style website and i want to integrate a detailed search facility for customers...
I'm after general advice on the best ways to do this.
All in all, there will be around 8 different filters to search. I want the user to be able to pick any number of filters and for the results to come back in a reasonable time.
My method so far is to firstly store all the search terms in the query string so that a customer can save the results if needed. My main problem is how best to run the query in SQL Server.
For example, if the user wants filtering on a,b,c and d.... do i create 4 seperate IF @a IS NOT NULL BEGIN style transactions? This could get very messy and long with 8 filters, in theory i'd have to write 64 different IF BEGIN statements which is not practical or good for performance!
Any advice or examples would be very gratefully received
View 3 Replies
ADVERTISEMENT
Nov 6, 2014
How to implement a universal search in my site And it must be give result precised up to 90%.
Scenario is like that whenever customer come to our site he/she can search for example: Car parts
My Table structure is like below:
Column 1 Column 2 Column 3 Column 4 column 5 column 6 (Keyword)
Toyota camry 2000 wheel ABC123 Toyota camry 2000 wheel abc123
Toyota camry 2000 wheel cover 123 Toyota camry 2000 wheel cover 123
Now i have created a full text search index on column 6(keyword)
so whenever someone search exactly describe in column 6 it gives result
For ex: if i search (Toyota Camry wheel) with CONTAINS Option
Select * from mytable where Contains
(Keyword,'Toyota and Camry and wheel')
It gives me rows which contains Toyota Camry wheel and other rows which having wheel cover also. So i get multiple rows. Because of we have very large table which contains data in millions its not to feasible to have that thing.
another thing is :
if i search (Toyota Camry wheels) with CONTAINS Option
Select * from mytable where Contains
(Keyword,'Toyota and Camry and wheels')
It won't give any result back to me which is embarrassment for me. Because customer can search anything so if its not giving result its bad impression.
Also i tried to use FREETEXT option but it gives result in combination of all this word which i searched. so its huge amount of data in result.
View 2 Replies
View Related
Dec 22, 2007
Hi,
am doing a project with SQL 2005 as backend.my database is in a shared
SQL server. i want to know that is it possible to send email through SQL in a a shared server?Plz help me out.
thanks in advance,
rekha
View 1 Replies
View Related
Mar 11, 2008
I am pushing data to a hosted facility and I can successfully push it from BIDS but the package fails login failure when scheduled as a job. I am not sure what to use on package protection level since this data is being pushed over the internet and If I encrypt all the data with a password it will be decrypted on the hosting facility.
Please help.
View 8 Replies
View Related
Nov 6, 2014
I have a scenario of where the standard Full-Text search identifies keywords but Semantic Search does not recognize them as keywords. I'm hoping to understand why Semantic Search might not recognize them. The context this is being used in medical terminology and the specific key words I noticed missing right off the bat were medications.
For instance, if I put the following string into a FT indexed table
'J9355 - Trastuzumab (Herceptin)'
AND
'J9355 - Trastuzumab emtansine'
The Semantic Search recognized 'Herceptin' and 'Emtansine' but not 'Trastuzumab'
Nor in
'J8999 - Everolimus (Afinitor)'
It did not recognize 'Afinitor' as a keyword.
In all cases the Base of Full-Text did find those keywords and were identifiable using the dmvsys.dm_fts_index_keywords_by_document.It does show the index as having completed.
why certain words might not be picked up while others would be? Could it be a language/dictionary issue? I am using English and accent insensitive settings?
View 0 Replies
View Related
Jul 24, 2007
would you use sql server "full text search" feature as your site index? from some reason i can't make index server my site search catalog, and i wonder if the full text is the solution. i think that i wll have to you create new table called some thing like "site text" and i will need to write every text twice- one the the table (let's say "articles table") and one to the text. other wise- there is problems finding the right urlof the text, searching different tables with different columns name and so on...
so i thought create site search table, with the columns:
id, text, url
and to write every thing to this table.
but some how ot look the wrong way, that every forum post, every article, album picture or joke will insert twice to the sqr server...
what do you think?
View 1 Replies
View Related
Dec 11, 2006
How can I search throught DOCX (MS Word 2007) documents by SQL Server 2005 Full Text Search engine?
Should I something download?
View 6 Replies
View Related
Aug 9, 2006
I'm just wonder if this is a bug in MS Search or am I doing something wrong.
I have a query below
declare @search_clause varchar(255)
set @Search_Clause = ' "hepatitis b" and "hepatocellular carcinoma"'
select * from results
where contains(finding,@search_clause)
I don't get the correct result at all.
If I change my search_clause to "hepatitis" and "hepatocellular carcinoma -- without the "b"
then i get the correct result.
It seems MS Search doesn't like the phrase contain one letter or some sort or is it a know bug?
Anyone know?
Thanks
View 3 Replies
View Related
Mar 29, 2008
Hi - I'm short of SQL experience and hacking my way through creating a simple search feature for a personal project. I would be very grateful if anyone could help me out with writing a stored procedure. Problem: I have two tables with three columns indexed for full-text search. So far I have been able to successfully execute the following query returning matching row ids: dbo.Search_Articles @searchText varchar(150) AS SELECT ArticleID FROM articles WHERE CONTAINS(Description, @searchText) OR CONTAINS(Title, @searchText) UNION SELECT ArticleID FROM article_pages WHERE CONTAINS(Text, @searchText); RETURN This returns the ArticleID for any articles or article_pages records where there is a text match. I ultimately need the stored procedure to return all columns from the articles table for matches and not just the StoryID. Seems like maybe I should try using some kind of JOIN on the result of the UNION above and the articles table? But I have so far been unable to figure out how to do this as I can't seem to declare a name for the result table of the UNION above. Perhaps there is another more eloquent solution? Thanks! Peter
View 3 Replies
View Related
Jul 21, 2015
Our clients want to be able to do full text search with a single letter. (Is the name Newton, Nathan, Nick?, Is the ID N1, N2...). Doing a single character full text search on a table work 25 out of 26 times. The letter that doesn't work is 'n'. the WHERE clause CONTAINS(full_text_field, ' "n*" ') returns all rows, even rows that have no 'n' in them anywhere. Adding a second letter after the "n" works as expected.
Here is an example
create table TestFullTextSearch (
Id int not null,
AllText nvarchar(400)
)
create unique index test_tfts on TestFullTextSearch(Id);
create fulltext catalog ftcat_tfts;
[Code] ....
View 4 Replies
View Related
Mar 30, 2013
I have installed the Adobe iFilter 11 64 bit and set the path to the bin folder. I still cannot find any text from the pdf files. I suspect I am missing something trivial because I don't find much when I Bing for this so it must not be a common problem.Here is the code.
--Adobe iFilter 11 64 bit is installed
--The Path variable is set to the bin folder for the Adobe iFilter.
--SQL Developer version 64 bit on both Windows 7 and Windows 8.
USE master;
GO
DROP DATABASE FileTableStudy;
GO
CREATE DATABASE FileTableStudy
ON PRIMARY
[code]....
View 14 Replies
View Related
Sep 14, 2004
Please help me to create an SQL Server 2000 Stored Procedure for using prefix and suffix terms.
Example:
Say I want to find "Terminator" (1984).
I want to be able to use "Term" or "ator" as search results and still return the proper record.
Here is my Stored Procedure creation sql:
CREATE PROCEDURE sps_searchTitles(@searchTerm varchar(255)) AS
SELECT * FROM Video
WHERE FREETEXT (Video.*, '"*@searchTerm*"')
GO
--- The above does not appear to properly check both prefix ("Term---") and suffix ("---ator") terms.
I am trying to accomplish what is similarly done with LIKE '%term%'.
thanks, YM
View 1 Replies
View Related
Mar 25, 2015
I have a table that contains words that will be used to search another table where FullText index has been created on searchable columns. I'm basically trying to run something like this:
SELECT t1.col1, t2.col3
FROM tbl1 t1, tbl2 t2
WHERE CONTAINS (t1.col1, t2.col1)
I know this won't work but is there a way to join these two tables so the words (t2.col1) can be passed as search conditions? There is no common key on both tables so normal join won't work. I'm trying to find a way to pass the search words from one table to another.
View 0 Replies
View Related
Jul 6, 2007
I have Sql server 2005 SP2.
I enabled it for Full Text search. Substring search where i enter *word* doesn't return any row.
I have a table testtable where description has word Extinguisher.
If i run a query with *ting* it doesn't return any row.
select * from testtable where contains(description,'"*xting*"') ;
But it works if i do
select * from testtable where contains(description,'"Exting*"') ;
The Full text search document says it supports substring search.
Is it an issue with sql server 2005?Please help.
View 7 Replies
View Related
Nov 1, 2015
I am using Sql Server 2014 Express edition.I have a table with a varchar(max) column. I have created a full text search that use the stoplist "system". column has this struct: xxx.yyy.zzz.... where xxx, yyy, zzz... are numbers, like 123.345.123123.366456...I can have rows like that:
123.345
123.345
123.345.444
123.345.555
123.345.666
123.345.444.777
123.345.444.888
123.345.555.999
I am trying this query:
select * from Mytable where
contains(MyColumn, '123.345.')
I gues the contains would return all the rows with column contains 123.345, but this does not return all the expected rows, only one row.I have tried to replace "." with "-" but the result is the same.I have also tried with '123.345.*. In this case I have got more results, but no all the exptected rows.If I use this query:
select * from MyTable where
MyCOlumn like '123.345.%';
View 12 Replies
View Related
Mar 1, 2007
Can anyone tell me how to search an SQL database for a given key word in a textbox? I basically have a database that has a qualifications column and this column needs to be searched for the data given in the textbox. Which is the best method to search for the data? Is it a simple SQL query or an XML based search engine type? Can anyone give any suggestions regarding this? If XML is efficient then how do I use it to query my database, as I'm pretty new in XML based searching.Thanks
View 5 Replies
View Related
Nov 22, 2007
hi there,
i am doing a school project and i need to have this search engine that will search the data that i have stored inside the database and display the results out
can anyone help?
thanks
View 6 Replies
View Related
Apr 2, 2004
for example:
SELECT * from [table1] WHERE CONTAINS([msgcomment], '"fast" NEAR "performance"')
would always slower than
SELECT * from [table1] WHERE [msgcomment] = '%fast%performance%'
Why? and how can it be solved? can you help me?
:)
View 6 Replies
View Related
Dec 6, 2011
My site uses a text box to allow visitors to search products. I'm trying to design the SQL Statement to allow search's on full words, part words, and words/phrases regardless of the order the words are in.
E.g.
megger
meg
mft megger (proper order in the database is megger mft)
mft1710 (using 1710 should find the product)
This is my select statement (classic ASP)
Code:
<%
Dim RSResults__param5
RSResults__param5 = "xxx"
If (Request("searchme") <> "") Then
RSResults__param5 = Request("searchme")
End If
[Code] ....
View 1 Replies
View Related
Jun 24, 2015
I'm experiencing an anomaly with my Full text index.
Setup : SQL Server 2005
Indexed Table:
Assets
ID - int (PK, auto increment)
Ref - varchar(50)
[code]....
I have re-built the full-text index, no change.
View 2 Replies
View Related
Jan 28, 2008
I have this simple full text search query that works perfectly on my own computer using sql server 2005 express, however, on the production server(shared hosting)when I added the first 50+ rows, the full text search works perfect, but as the number of rows increases, the full text search can only see the first50+ rows, but not the new ones. Is there any quick solution for this or it's just a common mistake for developers for not properly indexed columns?Is there a way to re-indexed all rows without loosing data on the live server? search query: SELECT TOP 50 *FROM li_BookmarksWHERE FREETEXT(Keywords,@Keywords)
View 2 Replies
View Related
Jan 14, 2006
I am developing a Recruitment Agency WebsiteI am using MS SQL Server in which I have a table called CV_Details which stores all the details of different Job Seekers. I have stored all the Word and PDF docs of the Job seekers in a 'mycatalog' using Index Server and stored the path in the CV_Details table along with rest of the cv details. Basically I want to download the cv's which i get after making a search in the doc's. I am able to get the filename, Path, Filesize by using Index Server Query.Is it anyway possible to extract all the CV Details data by matching the path.I want the cv details from the SQL Server of all the Related Paths at the same time not one at a time. Is it possible.I tried alot but i'm going nowhere. I'm giving my code below. Can anyone help me please.Thank you very much in Advance
string strCatalog = "TestCatalog", strsearchstrings=""; string strQuery=""; strsearchstrings = txtsearch.Text;
strQuery = "Select Filename,PATH from Scope() where FREETEXT('" +strsearchstrings+ "')"; // TextBox1.Text is the word that you type in the text box to query by using Indexing Service. string connstring = "Provider=MSIDXS.1;Integrated Security .='';Data Source="+strCatalog;
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connstring); conn.Open(); System.Data.OleDb.OleDbCommand objcmd = new System.Data.OleDb.OleDbCommand(strQuery, conn); System.Data.OleDb.OleDbDataReader objRdr;
objRdr = objcmd.ExecuteReader(); DataGrid1.DataSource=objRdr; DataGrid1.DataBind(); objRdr.Close(); conn.Close();
View 1 Replies
View Related
Jan 24, 2006
Are there any big differences between the two search techniques? It seems like they are both very similar.
SELECT * FROM TABLE1 WHERE TEXTFIELD1 LIKE '%DATABASES%'
SELECT * FROM TABLE1 WHERE CONTAINS (TEXTFIELD1 ,' "DATABASES" ')
View 2 Replies
View Related
Mar 5, 2008
Hi guys,
Am developing an application where I store the date in the database. I would like to search the date from the database table. Can anyone tell me how would the search string would look like?
The current string am using is: select Pid "ID", PName "Name", Address, DateOfBirth "Date Of Birth", Phone, emergencyContact "Emergency Contact", RegistrationDate "Registration Date", DischargeDate "Discharge Date" from patient_177681 Where RegistrationDate Like '%2005-3-4%'
But this string does not return any results and so does any other data in the Like % % string. Can anyone let me know how to compare two dates and return a result? Is there any in-built function to do this?
View 2 Replies
View Related
Jun 28, 2001
hi geeks,
I need to build a generic text search component for MS SQL server 7.0. It is basically one of those Database searches that appear on web sites. Is there any stored procedure or service that MS SQL server provides for text based search on a database. Mind u my requirement is not to search a table but aan entire database....
anyone done this before.....
keep the faith
Deepesh
View 1 Replies
View Related
Jan 9, 2008
Hi,
I realise this may seem a dumb question, but i am new to these things.
I have a database that i have created in sql server 2005 and at some point want to try to put it online.
I want to be able to take peoples details, so i dont want search engines reading those, but i would want the search engines to read other parts.
Will search engines read my database, or do they only read the pages generated from it?
If they will read my database, how do i stop them publishing stuff I dont want them to?
Kind regards,
Justin
View 2 Replies
View Related
Jul 23, 2005
hi,I'm building a simple search engine using keyword and title of a page:select ID, content_ID, 3 as 'weight'from tblPagewhere keywords LIKE '%test%'unionselect ID, content_ID, 2from tblPagewhere title LIKE '%test%'now I want to sum and order 'weight'thx
View 3 Replies
View Related
Mar 4, 2004
i am using this search
SELECT IDENT_CURRENT('t_Que') AS Expr1
and it will not return anything my primary key is a varchar with the length 12
will this command only work for an int as a primary key
and if so is there another way i could do this
my plan is to retrieve the last entered primary key so that i can generate a new one to add a new record to the database. the primary key is created by YYMMDDNN where
YY=year
MM=Month
DD=Day
NN=the number created that day
now just to be specific i dont need help creating the primary key i just need to know how to retrieve the previously created primary key.
I am trying this command directly in an sql query there is no code yet i am trying to see how the command functions first
View 6 Replies
View Related
Nov 6, 2004
Where do I find and enable full text search in sql server db?
I have hunted, and hunted, and stumbled, and looked with no luck.
Should it have been installed during set up?
Thanks all,
Zath
View 1 Replies
View Related
Jul 19, 2005
I have a server that has windows 2000 with Sql Server Enterprise edition sp3 installed and we are currently using the full text catalogs. I have another server that we have are trying to use the full text catalogs and it does not populate the catalog. I have check the microsoft search service to make sure it is logged in the same. I have gone through and recreated the catalogs twice and they will not populate. Can anyone give me any suggestion of things I can look for, Please ??
View 12 Replies
View Related
Apr 21, 2006
I found a search-and-replace program for SQL server that works GREAT, but I have a list of about 200 words to search for, with corresponding replacements. Rather than editing the code below for *each* word and running it 200 separate times, I'd like to iterate through the list, but my MS-SQL programming skills are...light (to say the least). Anyone have any ideas how I can create a list or hash-type variable and use the code to loop through and do the replacements all at once?
/*
*
* Search & Replace
*
* Use Ctrl+Shift+M to replace template values
*
*/
set xact_abort on
begin tran
declare @otxt varchar(1000)
set @otxt = '<string1, text, text to be replaced>'
declare @ntxt varchar(1000)
set @ntxt = '<string2, text, replacing text>'
declare @txtlen int
set @txtlen = len(@otxt)
declare @ptr binary(16)
declare @pos int
declare @id int
declare curs cursor local fast_forward
for
select
id,
textptr(<field_name, sysname, target text field>),
charindex(@otxt, <field_name, sysname, target text field>)-1
from
<table_name, sysname, target table>
where
<field_name, sysname, target text field>
like
'%' + @otxt +'%'
open curs
fetch next from curs into @id, @ptr, @pos
while @@fetch_status = 0
begin
print 'Text found in row id=' + cast(@id as varchar) + ' at pos=' + cast(@pos as varchar)
updatetext <table_name, sysname, target table> .<field_name, sysname, target text field> @ptr @pos @txtlen @ntxt
fetch next from curs into @id, @ptr, @pos
end
close curs
deallocate curs
commit tran
View 1 Replies
View Related
Sep 25, 2013
I'm using full text search in sql server 2008 with contain keyword.
My issue is while I'm trying
select * from tbl_item_master where contains (ITM_FULLTEXT,'red and white')
above syntax gives me required output but while I'm trying
select * from tbl_item_master where contains (ITM_FULLTEXT,'red and the and white')
above syntax does not gives me output. I'm using system stop list and "the" is noise keyword.
I want to stop searching "the" but want result as per first syntax.
I do get warning " The full-text search condition contained noise word(s)."
Is it possible?
View 1 Replies
View Related