How to display search results in a new form - vb.net

I've created a system and within that system i've a find/search page and a find/search results page. Basically, the find/search page consists of a number of text fields and the more the user completes, the more efficient the search will be.
I'm using SQL server 2005 to store the data and I can easily update/insert/save new data but I don't know how to search for the data ...
I want the user to fill out the fields in the find/search form and for the results to appear in the find/search results page. Can this be done?

It depends on what kind of Data you need to search.
If it's generic text data the best way is to use Full-Text Search

Yes. There are a number of ways you could achieve this. One possible way would be to pass the search criteria to the search results page via query string. Another way which is very similar is to store the search criteria in a session and redirect to the search results page. In either case on the search results page you'd want to take the data and build your SQL query. Depending on what you need you could utilize a full-text search like Kesty has suggested or you could simply use FIELD like '%user entered data%' in your queries. It really depends on your needs.

Related

SQL Server Search Multiple columns of different datatypes with one Value

So I have a table on a front end that is linked into my SQL Server backend. I can do paging and everything from there.
I'm trying to implement a good search function that can retrieve data across a variety of different columns the table has.
There is only one search bar, so I cannot search on each individual column separately.
An example of fields I have are
Field #
Requestor
Case #
Device Model
Submit Date
For whatever search term the user types in, using SQL Server I need to be able to search all the searchable columns and return rows where that value is similar to the search term.
I'm not sure how to begin or start with this, and how to also make it performant.
you could do something like select * from table where field# like '%input%' or requestor like %input% or case# like '%input%'... but I would recommend taking a look at sql full-text search

RSA - Archer - Hide multiple fields in a search result

When performing a search in Archer, the result contains some un-necessary fields. Is there a way to show only fields that belong to Application "General information" ? In other words, there are some fields that are suggested to being added to "General Information" tab which appear in a search result.
I know I can disable these fields by selecting the field, then clicking on "modify field properties", "options" and untick the show field in a search result.
Since I have multiple applications and a lot of fields, doing this will take a lot of time. Is there any script or trick to hide all these fields in a search result?
You could always use the API and create your own search XML to contain only the fields you want to see.
But short of doing that, I think you've hit the nail on the head. You'll need to go into each application and then modify each of the fields you don't want shown. I don't think it's a waste of time, as you're surely not changing this search result every time... it's a one time deal and if it makes it easier for you or the end users, it's certainly worth it IMO.
If you have access to the database then you can modify table "fielddef" and make fields not searchable by default. You can join "fielddef" table with "level" and "moduletranslation" and target only specific modules this way.
I don't have the SQL code for this since I didn't have to make a bulk update to the fields and make them not searchable.
It should take 5 min to join these 3 tables and make an update if you are good with SQL.

How to avoid retrieve entire stored field from solr

I'm using sunspot and solr for a rails app to search ebook contens, for highlight feature I have to set the ebook_content as a stored filed, every time I queried solr for result, it sends back the entire document content about the book, which makes the query very slow.
How could I only get the result without the stored field?
The fl parameter of Solr allows you to specify which fields you want returned in the result. If you had fields id, title, ebook_content, then you could use fl=id,title to omit the ebook_content field. I don't think there's support in Solr for getting all fields except one (e.g. -ebook_content).
Update
If you don't want to return the field in the normal results, but still want highlighting on that field, exclude the field as I described above, then turn on the highlighter:
hl=true
set the field(s) which should be highlighted:
hl.fl=ebook_content
and set the size of the highlighting fragment (in characters):
hl.fragsize=50
your finished query looks something like this:
?q=search term&fl=id,title&hl=true&hl.fl=ebook_content&hl.fragsize=50

How to filter a Sharepoint List Column with a Textbox Control Value using a "Contains" query?

I'm using a data view to display a list (Sharepoint 2010) that has several columns including one that has a Name column. I've provided the user with a text filter on the page to send values to filter the Name column in this list. The problem I'm facing is that the filter only works for exact matches and not partial matches.
I tried to overcome this problem by using Sharepoint Designer to:
create a parameter that uses the textbox control value.
Filtering the Name column with this parameter and setting the comparison to "Contains"
Unfortunately if the default value of the Parameter is blank, the list does not display any data. If the default value of the parameter is set to part of a name in the list, the list displays names that contain that string. However, when changing the value in the text box and searching, the list does not return results. Please let me know if you guys know how to fix this. Any help is much appreciated and let me know if you need any additional information. Thanks!
Managed to find a solution to my problem. I used a custom javascript solution designed by jvossers (http://instantlistfilter.codeplex.com) that involves the list being filtered instantly much like Google's search!
The only downside of this solution is that it only filters the items currently displayed on the screen. Therefore, if you have a data view web part which limits the amount of items displayed on the page, this solution won't help you. In order to facilitate this solution, display all the row items on the page (by increasing the item limit per page to a larger number than your total list rows) and then add this code into a content editor web part on the same page. Worked brilliantly for me. '
By the way if you are using jQuery 1.3.x or higher, you should modify the script a little as described in the disscussion here: http://instantlistfilter.codeplex.com/Thread/View.aspx?ThreadId=49123

Retrieving specific fields in a Solr query?

I am running a Solr instance on Jetty and when I search using the Solr admin panel, it returns the entire document. What should I do to get only specified fields from each Solr document returned by the search?
/?q=query&fl=field1,field2,field3
From the Solr Admin home page, click on "Full Interface". On that page there is a box called "Fields to Return". You can list the you want here (comma-separated). "*" means all fields.
http://xx.xxx.xx.xx:8983/solr/corename/select?indent=on&q=*:*&wt=json&fl=ImageID,Imagepath,Category
This link has fl parameter:
fl is a field list, which will display the specified fields from the indexed list.
The best way is to run the query from Admin concole. When we run it, it also provides the actuall SQL query executed. Just copy the query and use it.
About the question: select specific fields from the table. In the admin console look for 'FL' text box. write the field names you want to retrieve, comma sapereted. Hit the 'Execute Query' button.
Top right side the SQL will be available.
Generated Query: ......select?fl=FIELDNAME&indent=on&q=:&wt=json
you can simply pass fl parameter with required fields name in your query.
&fl=field1,field2,field3&query=:
your response documents contains only mentioned fields.