Developer forum

Forum » Development » Multiple fields in Searchlist

Multiple fields in Searchlist


Reply

Hi guys!

 

Does anyone know if it´s possible to pull out several values via the weighted search, on the list-level?

 

Usually, when you do a search, the tag "DwSearchResultList" will show you a list of items found, but only the headlines.

 

I need to do a search in Ecom, where I get the results from 3 different standard input boxes in Ecom. Is it possible to pull out these values and have them displayed on the list-level of the search?

 

Hope you all know what I'm talking about :)

 

/Casper


Replies

 
Reply

You could register a dummy module using the Developer module and set up that module to search in the desired fields in ecom.

 
Reply
Sorensen wrote:

You could register a dummy module using the Developer module and set up that module to search in the desired fields in ecom.


 

We tried that and that does give us the ability to search in specific fields of our choosing.

 

However, what I really want is to have the values of the fields displayed in my search results. Unfortunately, the template "SearchResultItem" only returns the Product Name... can I somehow get the values of other fields returned and displayed? Or would that require some custom development?

 

/Casper

 
Reply

Well' that would require either custom code, or instead of querying the database directly, you could create a view in the database and setup your search to query that.

 

If you want to display a summary of fields in your search result, you could do something like this:

 

SELECT '<b>' + MyField1 + '</b><br />' + MyField2 AS Description [and so on]

 
Reply
Sorensen wrote:

Well' that would require either custom code, or instead of querying the database directly, you could create a view in the database and setup your search to query that.

 

If you want to display a summary of fields in your search result, you could do something like this:

 

SELECT '<b>' + MyField1 + '</b><br />' + MyField2 AS Description [and so on]

Hmm... you´re gonna have to excuse me, because I might be asking alot of stupid questions :) The above query only selects the fields of my choosing, right? How would I proceed to get the values found in those fields displayed on a page or in a template? Am I missing something or is that custom-related?
 

/Casper

 
Reply

There are no stupid questions - only stupid people :) (my favorite Mr. Garrison quote)

 

No, sorry, please check this out, I'll be refering to that in the following: http://developer.dynamicweb.dk/default.aspx?id=16918&action=ShowArticle&ArticleID=32

 

Whatever field you enter in Body Text will be used as summary for the search result, so when doing this:

 

SELECT '<b>' + MyField1 + '</b><br />' + MyField2 AS Description [and so on]

 

I could enter Description in the Body Text field.

 

In order to display the details of the product you would of cause just redirect the user to a page containing the ecom catalog module.

 
Reply
Sorensen wrote:

There are no stupid questions - only stupid people :) (my favorite Mr. Garrison quote)

 

No, sorry, please check this out, I'll be refering to that in the following: http://developer.dynamicweb.dk/default.aspx?id=16918&action=ShowArticle&ArticleID=32

 

Whatever field you enter in Body Text will be used as summary for the search result, so when doing this:

 

SELECT '<b>' + MyField1 + '</b><br />' + MyField2 AS Description [and so on]

 

I could enter Description in the Body Text field.

 

In order to display the details of the product you would of cause just redirect the user to a page containing the ecom catalog module.

Are you allowed to run your query in the "Search in" field? Because we're getting an error message here, warning us about a possible unsafe operation. How do you run your query from that input box? We can´t seem to make it work.
 

 

Oh, and I might just be moving towards that previously mentioned category of "Stupid people"... :)

 

/Casper

 
Reply

Hehe... Don't worry:)

 

Sure, there's no validation of that here. Is a potentially dangerous parameter in query string? Could you please elaborate?

 
Reply
Sorensen wrote:

Hehe... Don't worry:)

 

Sure, there's no validation of that here. Is a potentially dangerous parameter in query string? Could you please elaborate?

I´m getting this error:
 

A potentially dangerous Request.Form value was detected from the client (ItemSearchFields="SELECT '<b>' + MyField1 + '<...").

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ItemSearchFields="SELECT '<b>' + MyField1 + '<...").

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

 

Sorry about the ugle cut&paste...

 
Reply

Oh, you misunderstood earlier. You should create a view on the SQL server database and then set up the search to perform a query on that.

 

Give me a call if you're still confused:)

 
Reply
Sorensen wrote:

Oh, you misunderstood earlier. You should create a view on the SQL server database and then set up the search to perform a query on that.

 

Give me a call if you're still confused:)

I didn´t misunderstand anything... my developer did :)
 

 

I´ll give you a call, when he finally snaps and begins to cry like a baby :)

 
Reply

Please do. I'd like to see that;)

 

You must be logged in to post in the forum