Try our conversational search powered by Generative AI!

boost the score of a page type

Vote:
 

Hi,

I'm using epi find for our search. In our search results, we have to show one specific page type first and then rest of the page types.

Is there any way to boost the score of page type ? I checked BestBets there you can only apply for a page not for entire page type.

Any help is appreciated !

thanks !

#116811
Feb 05, 2015 11:17
Vote:
 

Hello Suresh 

You should probably check out the BoostMatching capabilities of Find: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/75/DotNET-Client-API/Searching/Boosting-with-filters/

#116814
Feb 05, 2015 12:29
Vote:
 

Hi David,

thanks !! that is a really good pointer for me.

I'm using BoostMatching () but it is showing an error on InField(x=>x.PageName). Could you help me with this ?

                var query = SearchClient.Instance.Search<BasePage>(Language.Swedish).ForWithWildcards(Query)
                    .BoostMatching(x=>x.PageTypeName.Match("testpage"), 20)
                    .InField(x => x.PageName)                    
                    .AndInField(x => x.MainBody)
                    .BoostSummaryComments(10)
                    .AndInField(x => x.SearchText)
                    .InAllField()
                    .Track()
                    .Filter(ReadAccess_Filter)
                    .Filter(jpgFileTypeFilter)
                    .Filter(pngFileTypeFilter)
                    .Filter(gifFileTypeFilter)
                    .TermsFacetFor(x => x.SearchHitType, x => x.AllTerms = true);

Error :

    The type 'EPiServer.Find.Api.Querying.Queries.CustomFiltersScoreQuery' cannot be used as type parameter 'TExistingQuery' in the generic type or method 'EPiServer.Find.QueryStringSearchExtensions.InField<TSource,TExistingQuery>(EPiServer.Find.IQueriedSearch<TSource,TExistingQuery>, System.Linq.Expressions.Expression<System.Func<TSource,string>>, double?)'. There is no implicit reference conversion from 'EPiServer.Find.Api.Querying.Queries.CustomFiltersScoreQuery' to 'EPiServer.Find.Api.Querying.Queries.QueryStringQuery'.  

#116818
Feb 05, 2015 13:05
Vote:
 

Hi!

Move the BoostMatching further down you query, below the InAllFiled should do it.

Also, you could use MatchType in your BoostMatching:

.BoostMatching(x => x.MatchType(typeof(TestPage)),2)
#116856
Feb 06, 2015 9:28
Vote:
 

Hi Per,

thanks ! It works very well for me !!

now, I got some problem here. When I search for "erika" it shows "Hans erik", "Holmen erik".......

it seems it is taking only first 4 chars in search query text. Is there  any way to change this ?

tack !

#116857
Feb 06, 2015 11:13
Vote:
 

I guess that's the language stemming you're experiencing. You can remove the stemming effect by removing the langauge. 

#116860
Feb 06, 2015 11:41
Vote:
 

Hi,

I removed the stemming effect like this 

var query = SearchClient.Instance.Search<BasePage>(Language.Swedish).ForWithWildcards(Query)

But I'm still getting results like "erik" when I search for "erika" .

Could you give any pointer on this ?

tack !

#116970
Feb 09, 2015 11:24
Vote:
 

Not sure if I understand you correctly. Did you remove "Language.Swedish"? Here's some more information on stemming (at the bottom) : http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/8/DotNET-Client-API/Searching/Free-text-search/ 

#117014
Feb 10, 2015 7:29
Vote:
 
#117015
Feb 10, 2015 7:31
Vote:
 

Hi,

I have read link you suggested and tried removing stemming effect by specifing "Language.None". Still I'm getting "erik" for "erika".

#117173
Feb 12, 2015 17:10
Vote:
 

That sounds odd. Could the "ForWithWildcards" have anything to do with it? What if you test by invoking "For" instead? Also, if you really do not need stemming, I suppose you do not need InFields and AndInField, since you are using the InAllField. This should also remove any stemming effects.

#117174
Feb 12, 2015 17:36
Vote:
 

Hi again,

I used "For" and removed InFields, AndInField and InAllField, stil getting same results. I mean, getting "erik" for "erika".

 var query = SearchClient.Instance.Search<BasePage>(Language.None).For(Query)
                    .Track()
                    .Filter(ReadAccess_Filter)
                    .Filter(jpgFileTypeFilter)
                    .Filter(pngFileTypeFilter)
                    .Filter(gifFileTypeFilter)
                    .TermsFacetFor(x => x.SearchHitType, x => x.AllTerms = true)
                     .OrderByDescending(x=>x.StartPublish);

#117208
Feb 13, 2015 14:10
Vote:
 

Hi,

that sound very strange. It should not be possible! Are you doing a standard GetContentResult? Have you tried with different search queries? What if you go to the explore view in the EPiServer Find UI and search for "erika" there?

#117213
Feb 13, 2015 14:56
Vote:
 

Hi,

It is really strange !  Yes, I'm using standard GetResult().

You can take a look into screenshots here...

http://i.imgur.com/BqUTrsv.png

http://i.imgur.com/cRSw8Wy.png

#117278
Feb 16, 2015 15:32
Vote:
 

Looks like it is using stemming no matter what in your case. I see that you are on an older version - it might be a bug. Are you using the latest version of Find for cms 6?

It's a long shot, but there are no other properties on the pages with the value "erika", right? Do you get similar behavior if you search for "Henrika"?

#117279
Feb 16, 2015 15:46
Vote:
 

Hi,

I'm using episerver Find 1 R2 ( compatible to episerver cms 6 r2 ).

When I search for "Henrika" it is showing "Henrik Gustavsson".

#117280
Feb 16, 2015 15:56
Vote:
 

Maybe you should check with support. One more thing you could try is instead of specifying Language.None, you simply leave it blank. If that doesn't work you  could try specifying a language that is not supported by your index, like Language.Galician (unless you actually have an index that supports that language). It's not pretty, but it just might do the trick

#117282
Feb 16, 2015 18:31
Vote:
 

Hi Per,

Finally, it worked with Language.None and new index in epi find.

thanks !

#118234
Mar 03, 2015 11:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.