#192 "keywords" breaks "add_anchors_to_excerpt"

open
nobody
htsearch (60)
3
2003-10-27
2003-10-25
No

If a keyword occurs in a document before the search
words which are highlighted in the excerpt, then the
anchor is not inserted. (The anchor for the keyword
may be added -- there wasn't one for the case I
checked.) Should this be documented in 3.2.0? I don't
think it is worth fixing before then.

Discussion

  • Gilles Detillieux

    Logged In: YES
    user_id=149687

    I'm not sure this is really broken behaviour. The idea is to
    add an anchor to make it easier to find where the word first
    occurs in the document. When the word occurs before the
    first anchor, as it does when it's somewhere in the <head>
    portion of the document, then there's no anchor to add. You
    just use the main link to the document to start at the
    beginning. The anchor is only added if the word first occurs
    somewhere after an anchor. This is probably more of a
    documentation issue than a bug.

     
  • Gilles Detillieux

    • labels: --> htsearch
     
  • Gilles Detillieux

    Logged In: YES
    user_id=149687

    I'm not sure this is really broken behaviour. The idea is to
    add an anchor to make it easier to find where the word first
    occurs in the document. When the word occurs before the
    first anchor, as it does when it's somewhere in the <head>
    portion of the document, then there's no anchor to add. You
    just use the main link to the document to start at the
    beginning. The anchor is only added if the word first occurs
    somewhere after an anchor. This is probably more of a
    documentation issue than a bug.

     
  • Lachlan Andrew

    Lachlan Andrew - 2003-10-29

    Logged In: YES
    user_id=663373

    Thanks for your comment, Gilles. My point was that the role
    of the "keywords" attribute is only to limit those pages
    which can be displayed, and the presence of a "keywords"
    word should not affect whether or not the anchor is
    hyperlinked. If the search term, given by "words", occurs
    before the first anchor then I agree there should be no
    anchor linked. However in the case I encountered the
    "words" word was after the anchor, but the "keywords" word
    was before the anchor. In this case, I believe that the
    anchor should be highlighted. Thoughts?

     
  • Gilles Detillieux

    Logged In: YES
    user_id=149687

    Sorry, I didn't realise you were talking about the
    "keywords" attribute and/or CGI input parameter. I thought
    you meant "words" matching the meta keywords in an HTML
    document. Yes, I agree it would be desirable for htsearch to
    distinguish between words and keywords when it comes to
    handling the anchor links.

    However, it may be tricky to implement, and would likely at
    least require some changes to the query parser. Right now,
    the parser just sees one big boolean expression, and it
    doesn't know which words in that expression come from
    "keywords" and which come from "words". So, when the "or"
    operator merges two match lists, it can't tell what match
    was caused by what original list of words - it just picks
    the smallest anchor index. To implement what you're
    suggesting, you'd need to keep track of the origin of each
    word, and track that from the WeightWords class down through
    to the

    DocMatch class so that perform_or can make the right decision.

    I agree it's not worth fixing before then, so it would be
    worth documenting, as long as the documentation is clear
    that this is only a problem when using the keywords
    attribute or CGI parameter.

     
  • Nobody/Anonymous

    Logged In: NO

    I would like to add this as a feature request. I don't expect
    miracles, but it would be useful if a user could link directly to
    the portion of a document, a given excerpt is pulled from.

    It would make it more intuitive and confuse business people
    less lol.

    As it stands, if you click a hyperlinked search term in one
    excerpt, you are linked to the first label in doc, not the label
    where the excerpt is from.

    This is confusing, and counterintuitive. To work around it you
    can limit your results to one excerpt per page I suppose, but
    it would be tres cool if you could link to the label the excerpt
    is from when multiple excerpts are pulled.

    -neil

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks