Solved

Freetext search problem

Posted on 2009-06-30
5
651 Views
Last Modified: 2012-05-07
I have a sp that uses a freetext search to search a table in my database from a web fronty end text box.  The problem i'm  having is that when a value is null it throws up this error "Null or empty full-text predicate" is there a way I could make it search the whole table when the contents of the text box is null/empty???
0
Comment
Question by:leap29
  • 4
5 Comments
 
LVL 5

Expert Comment

by:rizwanidrees
Comment Utility
Replace Null with Space or %
0
 

Author Comment

by:leap29
Comment Utility
Thanks for the reply I've tried that and it doesn't seem to work.
e.g
declare @searchword nvarchar(50)
set @searchword = '%'
select * from jobs where freetext(Jobtitle

This should return about 5000 records but it's returning none at the moment.
0
 
LVL 5

Expert Comment

by:rizwanidrees
Comment Utility
You can write this query as

select * from jobs where Jobtitle like '%<user input text>%'
0
 
LVL 5

Expert Comment

by:rizwanidrees
Comment Utility
sorry, ignore my earlier comment, Try this

declare @searchword nvarchar(50)
set @searchword = ''

if @searchword = ''

select * from jobs where freetext(Jobtitle

else

select * from jobs

0
 
LVL 5

Accepted Solution

by:
rizwanidrees earned 500 total points
Comment Utility

declare @searchword nvarchar(50)
set @searchword = ''

if @searchword = ''

select * from jobs

else
select * from jobs where freetext(Jobtitle
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now