Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Weight is always 0 - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
sebking
#1 Posted : Thursday, November 14, 2013 2:06:33 PM
Rank: Member

Groups: Registered

Joined: 11/14/2013
Posts: 10
Hello
We are having a strange problem, where the Weight attribute in our search results always is 0. However, if we open the same index with the Management Tool and do the same search, the Weight column actually shows correct values.
Tried with both v2012.1 and v2012.2 versions. Strange thing our implementation used to work some time ago and has not been changed since in any apparent way.

Here is the code we are using:
Code:
var configuration = new Keyoti.SearchEngine.Configuration { IndexDirectory = KeyotiIndexPath };
var searchAgent = new SearchAgent(licenseKey, configuration);
var searchOptions = new SearchOptions { LocationCategoryName = CategoryName, ContentCategoryNames = Categories };
Keyoti.SearchEngine.Search.SearchResult search = searchAgent.Search(searchValue, searchOptions, 1, Int32.MaxValue);


Basically all is fine, except for the weight values which are 0 in all of the elements in search.
sebking
#2 Posted : Thursday, November 14, 2013 2:49:35 PM
Rank: Member

Groups: Registered

Joined: 11/14/2013
Posts: 10
I must correct, on some occasions we actually get a weight of something like 10... however in the index manager the weight value is something like 31190.
On another search for example the index manager gives weights between 1060 and 50 for the first 25 results, but in our code we get 0 for all of them.
Jim
#3 Posted : Friday, November 15, 2013 3:00:33 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi, the only things I can think of are:

- The Index manager doesn't search within location or content categories, does removing the searchOptions make a difference? If it does, it's our bug.

- Do you use a plug-in to modify weights?

- Do you have a boost factor? http://keyoti.com/produc...%20Section%20Weight.htm

- Have you modified the Weight Factors in configuration? WordWeightFactorBody etc. In theory it shouldn't matter since both searches (ours and yours) should load the config file.

Best
Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


sebking
#4 Posted : Friday, November 15, 2013 4:50:48 AM
Rank: Member

Groups: Registered

Joined: 11/14/2013
Posts: 10
Thanks for your reply.
Removing the SearchOptions does not make any difference. Also, we do use a plugin but for other things such as assigning categories and modifying titles, we do not modify any weights though. We don't have a boost factor anywhere and we left the weight factors in the configuration at their defaults (body: 10, title: 100, url: 90).
Jim
#5 Posted : Friday, November 15, 2013 2:38:35 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
I tried your code, but it worked fine (on my index without searchOptions). I hate to ask but could you reproduce it in something self contained that I can run please? (Upload with dropbox for eg. or email to my attention at support @ keyoti.com

Otherwise I can send you a working example, but I don't know if it will help much?



-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


sebking
#6 Posted : Thursday, November 21, 2013 9:21:16 AM
Rank: Member

Groups: Registered

Joined: 11/14/2013
Posts: 10
I will upload our index somewhere and send you a link by email then :)
Jim
#7 Posted : Thursday, November 21, 2013 1:20:38 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Thanks - I wrote the following code, in a console app

Code:

        public static void Main(string[] a)
        {
            var configuration = new Keyoti.SearchEngine.Configuration { IndexDirectory = @"C:\d\seb" };
            var searchAgent = new SearchAgent("5A556A61675D69626B5C6D6C644854263C3E3D423B41413E4345414746484B464C4E383D7", configuration);
            var searchOptions = new SearchOptions { LocationCategoryName = "DEU/DEU", ContentCategoryNames = new string[]{"Prospectus"}};
            Keyoti.SearchEngine.Search.SearchResult search = searchAgent.Search("DAX", searchOptions, 1, Int32.MaxValue);
            foreach (ResultItem item in search)
            {
                Console.WriteLine(item.UriString + "\t" + item.Weight);
            }

            Console.ReadLine();



Give this (which matches the info in the screenshot you sent)


Code:

http://-------------------------------/Prospectus/7ba0fddd-5b91-44c9-9f95-c9256d
6a8b69/prospectusdbxtrackers1_2013_06_01.pdf    1060
http://-------------------------------/Prospectus/f475a1fd-dc90-40db-9a11-7bb0be
e55b59/prospectusLU0490619193_2011_01.pdf       760
http://-------------------------------/Prospectus/bb1aa8fb-4d0d-4f3a-b128-5e3dc2
cde904/prospectusLU0274211217_2011_01.pdf       760



So it works fine. Looking in our revision history there is one thing related to weights, back in September 2012 we fixed an issue with wildcard based queries where the matched word was in capitals. Eg search for "da*" and it matches "DAX". If that's what you're doing then using the current release should fix it - if it didn't seem to then it means your search app probably isn't actually using the latest DLLs.

If this isn't the case, then please modify the code to make it act the way you describe, or send a completely self contained project, including references.

Best
Jim


-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


sebking
#8 Posted : Friday, November 22, 2013 9:02:44 AM
Rank: Member

Groups: Registered

Joined: 11/14/2013
Posts: 10
Holy cow. Your hint about the wildcard actually made me realize something: we were adding wildcards to our search term, so DAX was actually being given as *DAX* to Keyoti.
The wildcard at the end does not matter, but somehow Keyoti does not seem to like the wildcard at the front. Removing that makes Weights work fine again.
I verified and I am using the latest 2012.2 DLLs.
Jim
#9 Posted : Monday, November 25, 2013 2:24:59 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Please and upgrade to this MSI, it will fix it

http://keyoti.com/downlo...ightingStartWithFix.msi

Btw if you prefer to just get updated DLLs, I can send them.



-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


sebking
#10 Posted : Tuesday, November 26, 2013 10:59:06 AM
Rank: Member

Groups: Registered

Joined: 11/14/2013
Posts: 10
The installer is fine.
Thank you very much for your support! [:)]
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.