Nutch
  1. Nutch
  2. NUTCH-439

Top Level Domains Indexing / Scoring

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 1.0.0
    • Component/s: indexer
    • Labels:
      None

      Description

      Top Level Domains (tlds) are the last part(s) of the host name in a DNS system. TLDs are managed by the Internet Assigned Numbers Authority. IANA divides tlds into three. infrastructure, generic(such as "com", "edu") and country code tlds(such as "en", "de" , "tr", ). Indexing the top level domain and optionally boosting is needed for improving the search results and enhancing locality.

      1. tld_plugin_v2.3.patch
        176 kB
        Enis Soztutar
      2. tld_plugin_v2.2.patch
        176 kB
        Enis Soztutar
      3. tld_plugin_v2.1.patch
        178 kB
        Enis Soztutar
      4. tld_plugin_v2.0.patch
        184 kB
        Enis Soztutar
      5. tld_plugin_v1.1.patch
        71 kB
        Enis Soztutar
      6. tld_plugin_v1.0.patch
        71 kB
        Enis Soztutar

        Activity

        Hide
        Enis Soztutar added a comment -

        This is a plugin implementation for indexing and scoring top level domains in nutch. Tlds are stored in TLDEntry class, which has fields domain, status and boost fileds. The tlds are read from an xml file. There is also a xsd for validation.

        TLDIndexingFilter implements IndexingFilter interface to index the domain extensions (such as "net", "org", "en", "de") in the tld field.

        TLDScoringFilter implements ScoringFilter interface. Basically this filter multiplies the initial boost(coming from another scoring filter such as opic) by the boost of the domain. This way, by configuring boost of say "edu" domains to 1.1, the document boosts in the index of educational sites is boosted by 1.1. Also local search engines may wish to boost the domains hosted in that country. For ex. boosting "de" domains a little in a German SE seems reasonable. An alternative usage may be to lower the boosts of domains such as biz, or info, which are known to have lots of spam.

        The users can also query the tld field for advanced search.

        Implementation note : 1. OpicScoringFilter is changed to respect ScoringFilter chaining.
        2. some of the second level domains such as co.uk is not recognized, but edu.uk is recognized

        Show
        Enis Soztutar added a comment - This is a plugin implementation for indexing and scoring top level domains in nutch. Tlds are stored in TLDEntry class, which has fields domain, status and boost fileds. The tlds are read from an xml file. There is also a xsd for validation. TLDIndexingFilter implements IndexingFilter interface to index the domain extensions (such as "net", "org", "en", "de") in the tld field. TLDScoringFilter implements ScoringFilter interface. Basically this filter multiplies the initial boost(coming from another scoring filter such as opic) by the boost of the domain. This way, by configuring boost of say "edu" domains to 1.1, the document boosts in the index of educational sites is boosted by 1.1. Also local search engines may wish to boost the domains hosted in that country. For ex. boosting "de" domains a little in a German SE seems reasonable. An alternative usage may be to lower the boosts of domains such as biz, or info, which are known to have lots of spam. The users can also query the tld field for advanced search. Implementation note : 1. OpicScoringFilter is changed to respect ScoringFilter chaining. 2. some of the second level domains such as co.uk is not recognized, but edu.uk is recognized
        Hide
        Enis Soztutar added a comment -

        I have forgotten to unset http.agent.name in the v1.0 accidentally. this version is the same except agent name is not set. This patch obsoletes v1.0.

        Show
        Enis Soztutar added a comment - I have forgotten to unset http.agent.name in the v1.0 accidentally. this version is the same except agent name is not set. This patch obsoletes v1.0.
        Hide
        Enis Soztutar added a comment -

        I have made major improvements to the code and configuration files. Mainly the issue is not only a plugin, but a package, one big xml file, and an indexing/scoring plugin(which is disabled by default). The list of recognized suffixes now is not limited to top level domains. second, or third level public domain names can be recognized. The patch also changes the naming from top level domains to domain suffixes.

        This patch also introduces URLUtil class, which include methods for getting domain name, or public domain suffix of an url. Finding the domain name of a url is quite important for several reasons. First we can use this function as an replacement of URL.getHost() in LinkDB for ignoring internal links, or in similar context. Second we can perform statistical analysis on domain names. Third we can list subdomains under a domain, etc..

        I have changed the build.encoding to UTF-8 so that non-ascii characters are recognized.

        here is an excerpt from the domain-suffixes.xml file :
        This document contains top level domains
        as described by the Internet Assigned Numbers
        Authotiry (IANA), and second or third level domains that
        are known to be managed by domain registerers. People at
        Mozilla community call these as public suffixes or effective
        tlds. There is no algorithmic way of knowing whether a suffix
        is a public domain suffix, or not. So this large file is used
        for this purpose. The entries in the file is used to find the
        domain of a url, which may not the same thing as the host of
        the url. For example for "http://lucene.apache.org/nutch" the
        hostname is lucene.apache.org, however the domain name for this
        url would be apache.org. Domain names can be quite handy for
        statistical analysis, and fighting against spam.

        The list of TLDs is constructed from IANA, and the
        list of "effective tlds" are constructed from Wikipedia,
        http://wiki.mozilla.org/TLD_List, and http://publicsuffix.org/
        The list may not include all the suffixes, but some
        effort has been spent to make it comprehensive. Please forward
        any improvements for this list to nutch-dev mailing list, or
        nutch JIRA.

        Show
        Enis Soztutar added a comment - I have made major improvements to the code and configuration files. Mainly the issue is not only a plugin, but a package, one big xml file, and an indexing/scoring plugin(which is disabled by default). The list of recognized suffixes now is not limited to top level domains. second, or third level public domain names can be recognized. The patch also changes the naming from top level domains to domain suffixes. This patch also introduces URLUtil class, which include methods for getting domain name, or public domain suffix of an url. Finding the domain name of a url is quite important for several reasons. First we can use this function as an replacement of URL.getHost() in LinkDB for ignoring internal links, or in similar context. Second we can perform statistical analysis on domain names. Third we can list subdomains under a domain, etc.. I have changed the build.encoding to UTF-8 so that non-ascii characters are recognized. here is an excerpt from the domain-suffixes.xml file : This document contains top level domains as described by the Internet Assigned Numbers Authotiry (IANA), and second or third level domains that are known to be managed by domain registerers. People at Mozilla community call these as public suffixes or effective tlds. There is no algorithmic way of knowing whether a suffix is a public domain suffix, or not. So this large file is used for this purpose. The entries in the file is used to find the domain of a url, which may not the same thing as the host of the url. For example for "http://lucene.apache.org/nutch" the hostname is lucene.apache.org, however the domain name for this url would be apache.org. Domain names can be quite handy for statistical analysis, and fighting against spam. The list of TLDs is constructed from IANA, and the list of "effective tlds" are constructed from Wikipedia, http://wiki.mozilla.org/TLD_List , and http://publicsuffix.org/ The list may not include all the suffixes, but some effort has been spent to make it comprehensive. Please forward any improvements for this list to nutch-dev mailing list, or nutch JIRA.
        Hide
        Andrzej Bialecki added a comment -

        Very nice patch! A couple comments:

        • the fix to OPICScoringFilter - I will make this as a separate commit (no need to create a separate patch).
        • IP_PATTERN - it could be tighter, instead of
          d+ it could use
          d {1,3}
        • the DomainStatistics tool: I'd rather see it as a separate JIRA issue. The reason is that it's a common request for enhancement, but specific requirements vary wildly. Some users prefer to build a separate DB that holds staistical info and can be used in various steps of the work cycle, others still prefer one-time tools such as this one.
        Show
        Andrzej Bialecki added a comment - Very nice patch! A couple comments: the fix to OPICScoringFilter - I will make this as a separate commit (no need to create a separate patch). IP_PATTERN - it could be tighter, instead of d+ it could use d {1,3} the DomainStatistics tool: I'd rather see it as a separate JIRA issue. The reason is that it's a common request for enhancement, but specific requirements vary wildly. Some users prefer to build a separate DB that holds staistical info and can be used in various steps of the work cycle, others still prefer one-time tools such as this one.
        Hide
        Enis Soztutar added a comment -

        > Very nice patch!
        Thanks !
        > IP_PATTERN - it could be tighter, instead of
        d+ it could use
        d

        {1,3}
        now it is (
        d{1,3}


        .)

        {3}

        (
        d

        {1,3}

        )

        >the DomainStatistics tool: I'd rather see it as a separate JIRA issue. The reason is that it's a common request for enhancement, but specific requirements vary wildly. Some users prefer to build a separate DB that holds staistical info and can be used in various steps of the work cycle, others still prefer one-time tools such as this one.

        DomainStatistics is really a quick hack i've written for demonstration of the new patch. I've moved it from the latest patch. Once the user requirements are settled, we can move on from there.

        Also you may not want to commit MozillaPublicSuffixListParser.java, but it is good we have it somewhere public.

        Show
        Enis Soztutar added a comment - > Very nice patch! Thanks ! > IP_PATTERN - it could be tighter, instead of d+ it could use d {1,3} now it is ( d{1,3} .) {3} ( d {1,3} ) >the DomainStatistics tool: I'd rather see it as a separate JIRA issue. The reason is that it's a common request for enhancement, but specific requirements vary wildly. Some users prefer to build a separate DB that holds staistical info and can be used in various steps of the work cycle, others still prefer one-time tools such as this one. DomainStatistics is really a quick hack i've written for demonstration of the new patch. I've moved it from the latest patch. Once the user requirements are settled, we can move on from there. Also you may not want to commit MozillaPublicSuffixListParser.java, but it is good we have it somewhere public.
        Hide
        Enis Soztutar added a comment -

        Oops, it seems that i've uploaded the wrong file. This is the correct one.

        Show
        Enis Soztutar added a comment - Oops, it seems that i've uploaded the wrong file. This is the correct one.
        Hide
        Doğacan Güney added a comment -

        A big +1 from me. Though, it may be useful to break this patch into multiple pieces (fixes to opic and build system as a seperate patch, core changes as a seperate patch and plugin as a seperate patch).

        IMHO, most usages of URL.getHost should be replaced with this patch's getDomainName. For example, "host" field in index gets a big boost currently. But it is easy to spam hosts. Just buy a host 'example.com' then set up your own dns and add 'foo.example.com', 'bar.example.com', 'baz.example.com'. I have actually seen a lot of spam sites that do this. Doing this in linkdb reduces anchor spam (where 'foo.example.com' gives a link to 'bar.example.com' and nutch considers this an external link and stores this anchor).

        Another example is generator. Instead of partitioning on host or ip, we can partition urls based on their domains. This doesn't have the overhead of resolving ips (and ip-resolving also has problems. Urls under the same domain [sometimes even the same url] may be served from different ips [think load balancers and stuff]) and will be much more polite and resistant to honey pots.

        Show
        Doğacan Güney added a comment - A big +1 from me. Though, it may be useful to break this patch into multiple pieces (fixes to opic and build system as a seperate patch, core changes as a seperate patch and plugin as a seperate patch). IMHO, most usages of URL.getHost should be replaced with this patch's getDomainName. For example, "host" field in index gets a big boost currently. But it is easy to spam hosts. Just buy a host 'example.com' then set up your own dns and add 'foo.example.com', 'bar.example.com', 'baz.example.com'. I have actually seen a lot of spam sites that do this. Doing this in linkdb reduces anchor spam (where 'foo.example.com' gives a link to 'bar.example.com' and nutch considers this an external link and stores this anchor). Another example is generator. Instead of partitioning on host or ip, we can partition urls based on their domains. This doesn't have the overhead of resolving ips (and ip-resolving also has problems. Urls under the same domain [sometimes even the same url] may be served from different ips [think load balancers and stuff] ) and will be much more polite and resistant to honey pots.
        Hide
        Enis Soztutar added a comment -

        As for Doğacan's comments I've opened issues NUTCH-518 and NUTCH-517.

        Show
        Enis Soztutar added a comment - As for Doğacan's comments I've opened issues NUTCH-518 and NUTCH-517 .
        Hide
        Enis Soztutar added a comment -

        This patch includes "core" domain utilities and the tld plugin, but excludes the changes in NUTCH-517 and NUTCH-518.

        Show
        Enis Soztutar added a comment - This patch includes "core" domain utilities and the tld plugin, but excludes the changes in NUTCH-517 and NUTCH-518 .
        Hide
        Doğacan Güney added a comment -

        If there are no objections, I am going to commit this one.

        This is a big change, but it is almost completely self contained (besides the tld plugin which is disabled by default), so there should be no harm in committing it. Later, we can discuss whether it is useful to replace URL.getHost with getDomainName on a case-by-case basis.

        (FWIW, I think scoring-opic and linkdb should use domain name instead of host.)

        Show
        Doğacan Güney added a comment - If there are no objections, I am going to commit this one. This is a big change, but it is almost completely self contained (besides the tld plugin which is disabled by default), so there should be no harm in committing it. Later, we can discuss whether it is useful to replace URL.getHost with getDomainName on a case-by-case basis. (FWIW, I think scoring-opic and linkdb should use domain name instead of host.)
        Hide
        Andrzej Bialecki added a comment -

        Some minor issues:

        • TLDScoringFilter contains a misspelled field, tldEnties, it should be renamed to tldEntries. Functionally it's of course the same, it's just a puzzling name that is easy to misspell (ie. spell correctly ).
        • one of the use cases for the "tld" index field that you mention is that users may search on it. But in the latest patch this field is added with Field.Index.NO, which makes searching on it impossible. Also, in order to search on arbitrary Lucene fields Nutch needs a Query filter, so we would need a TLDQueryFilter, which doesn't exist (yet?).

        Other than that, +1 from me.

        Re: using domain names instead of host names - we need to discuss this further, let's create a separate issue on this.

        Show
        Andrzej Bialecki added a comment - Some minor issues: TLDScoringFilter contains a misspelled field, tldEnties, it should be renamed to tldEntries. Functionally it's of course the same, it's just a puzzling name that is easy to misspell (ie. spell correctly ). one of the use cases for the "tld" index field that you mention is that users may search on it. But in the latest patch this field is added with Field.Index.NO, which makes searching on it impossible. Also, in order to search on arbitrary Lucene fields Nutch needs a Query filter, so we would need a TLDQueryFilter, which doesn't exist (yet?). Other than that, +1 from me. Re: using domain names instead of host names - we need to discuss this further, let's create a separate issue on this.
        Hide
        Enis Soztutar added a comment -

        TLDScoringFilter contains a misspelled field, tldEnties, it should be renamed to tldEntries

        Done!

        one of the use cases for the "tld" index field that you mention is that users may search on it. But in the latest patch this field is added with Field.Index.NO, which makes searching on it impossible. Also, in order to search on arbitrary Lucene fields Nutch needs a Query filter, so we would need a TLDQueryFilter, which doesn't exist (yet?).

        Well, infact NUTCH-445 covers searching on tlds, namely we would be able to search site:lucene.apache.org, or site:apache.org or even site:org, therefore i think indexing tld fields and TLDQueryFilter is not needed. I will delve deeper into NUTCH-445 as soon as i find some time. We can move domain indexing functionality to index-basic so that it will be generic enough.

        using domain names instead of host names - we need to discuss this further, let's create a separate issue on this.

        we can open issues case by case since the patches is expected to have major side effects.

        Show
        Enis Soztutar added a comment - TLDScoringFilter contains a misspelled field, tldEnties, it should be renamed to tldEntries Done! one of the use cases for the "tld" index field that you mention is that users may search on it. But in the latest patch this field is added with Field.Index.NO, which makes searching on it impossible. Also, in order to search on arbitrary Lucene fields Nutch needs a Query filter, so we would need a TLDQueryFilter, which doesn't exist (yet?). Well, infact NUTCH-445 covers searching on tlds, namely we would be able to search site:lucene.apache.org, or site:apache.org or even site:org, therefore i think indexing tld fields and TLDQueryFilter is not needed. I will delve deeper into NUTCH-445 as soon as i find some time. We can move domain indexing functionality to index-basic so that it will be generic enough. using domain names instead of host names - we need to discuss this further, let's create a separate issue on this. we can open issues case by case since the patches is expected to have major side effects.
        Hide
        Enis Soztutar added a comment -

        By the way, Andrzej could you please enable support for wiki style editing for Nutch JIRA, similar to Hadoop's. Specifically I find

        
        

        's and bq. quite useful.

        Show
        Enis Soztutar added a comment - By the way, Andrzej could you please enable support for wiki style editing for Nutch JIRA, similar to Hadoop's. Specifically I find 's and bq. quite useful.
        Hide
        Enis Soztutar added a comment -

        Recently Matt Cutts have written about parts of the urls :
        http://www.mattcutts.com/blog/seo-glossary-url-definitions/

        it seems that, as expected, google deals with different parts of the urls. smile

        Show
        Enis Soztutar added a comment - Recently Matt Cutts have written about parts of the urls : http://www.mattcutts.com/blog/seo-glossary-url-definitions/ it seems that, as expected, google deals with different parts of the urls. smile
        Hide
        Doğacan Güney added a comment -

        Committed in rev. 568053.

        I left MozillaPublicSuffixListParser class out after a discussion with Enis.

        Show
        Doğacan Güney added a comment - Committed in rev. 568053. I left MozillaPublicSuffixListParser class out after a discussion with Enis.
        Hide
        Doğacan Güney added a comment -

        Resolved and committed.

        Show
        Doğacan Güney added a comment - Resolved and committed.
        Hide
        Hudson added a comment -
        Show
        Hudson added a comment - Integrated in Nutch-Nightly #184 (See http://lucene.zones.apache.org:8080/hudson/job/Nutch-Nightly/184/ )

          People

          • Assignee:
            Enis Soztutar
            Reporter:
            Enis Soztutar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development