Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Murray Roke 503 posts 966 karma points c-trib
    May 11, 2010 @ 03:38
    Murray Roke
    0

    Examine Index search result shows first content node, except after calling RebuildIndex

    Hi all

    I've got a particular issue with Examine where if I run this:

    foreach (BaseIndexProvider indexer in ExamineManager.Instance.IndexProviderCollection)
    {
    indexer.RebuildIndex();
    }

    All my search results are perfect.

    I open another window into the CMS and individually publish one of the nodes that appears in the search results.

    I refresh my search with the same query, now the node that was showing perfectly is replaced by the first node under my homepage.

    I can do this for every result in the search and they will all change to the first node under my homepage.

    I'm not sure what to do now :-}

     

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 11, 2010 @ 05:25
    Aaron Powell
    0

    Is the index being overwritten or is just the results that are acting weird? You can use Luke (http://code.google.com/p/luke/) to inspect a Lucene index.

    Are you doing the RebuildIndex yourself?

    What version of Examine are you using?

  • Murray Roke 503 posts 966 karma points c-trib
    May 11, 2010 @ 07:35
    Murray Roke
    0

    When I publish the node, the Index version changes (if I re-open the index in luke)

    I haven't figured out how to get the 'search' to work in luke (so it will search all fields in the same way that examine does)

    Yes, I call the RebuildIndex myself. (I added a button in the dev dashboard)

    (Examine-0.9.2.0) (Examine.dll FileVersion: 1.0.2085.34555 )

     

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 11, 2010 @ 09:05
    Aaron Powell
    0

    Luke uses raw Lucene queries. You can get the query by calling ToString on the ISearchCriteria once it's compiled (or viewing it in the debugger).

    You shouldn't have a need to call RebuildIndex if you're publishing. Examine ties into the Umbraco events around saving and publishing and will do all that stuff on your behalf.

  • Murray Roke 503 posts 966 karma points c-trib
    May 12, 2010 @ 05:01
    Murray Roke
    0

    Luke seems to find the correct records after I 'publish' the node. the score and Doc. Id are different, I guess because it has been replaced in the index. But in all everything looks fine.

    So I guess the problem is somewhere in the search.

    Also, I discovered if I reload the application (touch the web.config or recompile) then the results start coming out sweet again.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 12, 2010 @ 05:28
    Aaron Powell
    0

    Do you feel brave and want to try the latest change set in codeplex?

    I think the problem is/ was caused by the opening/ closing the index reader and searcher each time. We've now singletoned them (which is also meant to improve performance).

    I hadn't seen this happening with the sites I've been testing it with, but those sites have some very extensive event handlers running which could be affecting the tests.

    What's currently in codeplex will become RC3 anyway (unless we have to do bug fixes :P).

  • Murray Roke 503 posts 966 karma points c-trib
    May 12, 2010 @ 06:53
    Murray Roke
    0

    sweet, that's fixed it :-)

Please Sign in or register to post replies

Write your reply to:

Draft