Project

General

Profile

« Previous | Next » 

Revision 60750

[Library|Trunk]
- Cache Interceptor service: add explore home page search queries (stats numbers)
- Result Landing: enhance noindex filter (avoid common title/authors/abstract)
- Search module: remove unused module

View differences:

resultLanding.component.ts
641 641
            || (this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0)
642 642
          )
643 643
       );
644
       //words to exclude
644
       //spam words to exclude
645 645
        let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "TUBYDI"];
646 646
        let abstract_words = ["operacao-feliz-natal.blogspot.com", "moviedouban.site", "hack-expert-solution.link"];
647 647
        allow = allow &&  !(
648
          (this.hasKeyword(this.resultLandingInfo.title.toLowerCase(),title_authors_words) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.join(" ").toLowerCase(),title_authors_words))
649
            || (this.resultLandingInfo.description && this.hasKeyword(this.resultLandingInfo.description.toLowerCase(),abstract_words))
648
          (this.hasKeyword(this.resultLandingInfo.title,title_authors_words) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.map(o => o.fullName).join(" "),title_authors_words))
649
            || (this.resultLandingInfo.description && this.hasKeyword(this.resultLandingInfo.description,abstract_words))
650 650
          ) &&
651 651
          (this.resultLandingInfo.publisher == "Zenodo" ||
652
            this.resultLandingInfo.hostedBy_collectedFrom.filter( value => {return value.downloadName && value.downloadName.toLowerCase().indexOf("zenodo")!=-1}).length > 0));
652
            this.resultLandingInfo.hostedBy_collectedFrom.filter( value => {return value.downloadName && value.downloadName.indexOf("zenodo")!=-1}).length > 0));
653
        //common titles/ description / authors
654
        let common_titles = ["introduction", "editorial", "book reviews", "preface", "reviews", "none", "book review", "foreword", "conclusion", "review", "reply","einleitung","short notices","erratum","discussion", "letters to the editor","letter to the editor","reviews of books",":{unav)","editorial board"];
655
        let common_abstract = ["international audience","n/a","peer reviewed","national audience","info:eu-repo/semantics/published","-",".","graphical abstract","met lit. opg","international audience; no abstract",'<jats:p>.</jats:p>',"politics","info:eu-repo/semantics/publishedversion","copia digital. madrid : ministerio de educación, cultura y deporte, 2016",'<jats:p />',"peer-reviewed","copia digital. madrid : ministerio de educación, cultura y deporte. subdirección general de coordinación bibliotecaria, 2015","<jats:p>-</jats:p>","imperial users only","yüksek lisans"];
656
        let common_authors = ["[s.n.]","null &na;","nn","(:unap)","(:null)","null anonymous","anonymous"];
657
        allow = allow &&  !(
658
          this.isKeyword(this.resultLandingInfo.title,common_titles) || this.isKeyword(this.resultLandingInfo.description,common_abstract) ||
659
          (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.map(o => o.fullName).join(" "),common_authors))
660
        );
653 661
        if(!allow) {
654 662
          this._meta.updateTag({content: 'noindex'}, "name='robots'");
655 663
        }
......
660 668
    }
661 669
  }
662 670
  private hasKeyword(value:string, words:string[]){
663
    return words.filter( word => { return value.indexOf(word)!=-1}).length > 0;
671
    return words.filter( word => { return value.toLowerCase().indexOf(word)!=-1}).length > 0;
664 672
  }
673
  private isKeyword(value:string, words:string[]){
674
    return words.filter( word => { return value.toLowerCase() == word}).length > 0;
675
  }
665 676
}

Also available in: Unified diff