Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Indexed Text Conversion To ResultItem Summary - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
jkagerer
#1 Posted : Wednesday, September 17, 2014 4:01:19 PM
Rank: Member

Groups: Registered

Joined: 9/4/2014
Posts: 20
I have an MSSQL Source where the Raw Indexed Text is almost exactly what I need for the ResultItem Summary.

However, I get a variety of Summaries based on my Search Query. Unfortunately in most cases the Summary is including unwanted data and excluding preferred data. In this case the first two integers are indexes that are useless to the consumer.

Example:
Indexed Text:
9704 866 2003 ABC-123F Jet Pump(1/2)(JT1200-B1) RING-O 92055-3774

Resulting Summary Text:
9704 866 2003 ABC-123F Jet Pump(1/2)(JT1200-B1)

Preferred Summary Text:
2003 ABC-123F Jet Pump(1/2)(JT1200-B1) RING-O 92055-3774

Is there anyway to intercept how the summary is created and customize my own summary?

Thank You for your help.
Joe
Joe
harry
#2 Posted : Wednesday, September 17, 2014 4:54:04 PM
Rank: Member

Groups: Registered

Joined: 4/22/2006
Posts: 216
Joe, you can set Configuration.ResultSummaryType to ResultSummaryType.StaticBodyStart and that will give you a consistent summary for each result.

You can modify what is shown by editing the ResultItem template in the search result page. Our default ResultItemTemplate has

Code:

<%# Container.Summary%>


you can modify it to

Code:

<%# CustomizeResultSummary(Container.Summary)%>



and then add (in the codebehind)

public string CustomizeResultSummary(string summary){

}

summary will be "9704 866 2003 ABC-123F Jet Pump(1/2)(JT1200-B1)"

and you just need to return what you want instead.

Kind regards

-Harry
-Harry
jkagerer
#3 Posted : Wednesday, September 17, 2014 5:02:54 PM
Rank: Member

Groups: Registered

Joined: 9/4/2014
Posts: 20
Hi Harry,

Thanks for your quick response.

I have two questions:
1) will changing ResultSummaryType to ResultSummaryType.StaticBodyStart return the entire Indexed Text to the Summary? I have Summary Word Length set to 50
2) will this changing this type require reindexing?

Update:
I changed it to StaticBodyStart, with no re-indexing and my Summary Text came back as "Jet Pump(1/2)(JT1200-B2)", even less details. Will re-indexing change this?

Thank You,
Joe
Joe
harry
#4 Posted : Thursday, September 18, 2014 12:43:43 AM
Rank: Member

Groups: Registered

Joined: 4/22/2006
Posts: 216
Sorry Joe, I forgot that only the 2nd column from your SELECT statement is used for the static summary. But this would be a better solution anyway, just concat the fields you actually want to use for the summary, as the 2nd column in the select.

See http://www.mssqltips.com...o-a-string-with-concat/

Eg. (you can use concat in MSSQL2012)

SELECT
Title,
CONCAT(Title,' ',FirstName,' ',MiddleName,' ',LastName) as MailingName,
FirstName,
MiddleName,
LastName

FROM Person.Person


You will of course need to reindex if you do that.

If reindexing is a problem, then you could try using the default summary type, but set the summary word length to a large number so that all words in the record are used for the summary, which you can then customize as I mentioned before.


-Harry
-Harry
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.