[Egothor-tech] question

Leo Galambos Leo.Galambos at egothor.org
Thu Mar 3 14:33:38 GMT 2005


Peter Zozulak wrote:

>Hello,
>
>after some time I returned back to play and test with Egothor on our
>servers.
>
>I need the search engine for 10 websites with some 100.000 articles over
>several years.
>
>But I need to sort the results not based on relevance only, but also count
>the date of the article was published.
>
>Example: searching when for "football scores" the top results should be from
>yesterday and not 5 years ago.
>
>how to setup this in egothor? I think it can be done, but due the lack of
>documentation I'm unable to find out how ;-(
>
>  
>

Hi, you would have to add a special token with a proper weight (to the 
respective document).

For instance, if the document was published on 21220 (2002-12-20), you 
would add a token "<VALUE>mytop" with the weight 21220. Something 
similar is implemented in 
var/extra/egothor-virtspace/.../HTMLDocument.java, you would only use:
    String t = "<VALUE>" + ...; MemoryIList l = new MemoryIList(t);
    l.add(new MemoryListItem(root.getUID(), 21220, null)); ilists.put(t, l);
Also apply this patch in src/kernel/org/egothor/query:
*** Configuration.java.orig     Thu Mar  3 15:25:18 2005
--- Configuration.java  Thu Mar  3 15:25:29 2005
***************
*** 77,83 ****
       *  hash table could be better than this
       */
      private final static String[] CONTROLTOKENS = {"<SRC>", 
"<!VOLATILE>", "<VALUE>"};
!     private final static int[] WEIGHTCONTROLTOKENS = {0, 100, 0};

      /**
       *  Is this a control token which is not excluded when it has a low
--- 77,83 ----
       *  hash table could be better than this
       */
      private final static String[] CONTROLTOKENS = {"<SRC>", 
"<!VOLATILE>", "<VALUE>"};
!     private final static int[] WEIGHTCONTROLTOKENS = {0, 100, 100};

      /**
       *  Is this a control token which is not excluded when it has a low


Now, queries without "<VALUE>mytop" will be ordered by a pure weight, 
while queries with "<VALUE>mytop" will be ordered by a date.

Cheers,
Leo

-- 
Leo Galambos
Faculty of Mathematics and Physics, DSE
Malostranske namesti 25
Prague 1
CZE

http://kocour.ms.mff.cuni.cz/~galambos/




More information about the Egothor-tech mailing list