-
-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
!!![TASK] Clean and optimize frontend helper: PageIndexer
Cleans and optimizes the frontend helper "PageIndexer" integration test. Failure test for non existing pages/sites is refactored and PageIndexer adapted, even if AfterCacheableContentIsGeneratedEvent is not dispatched e.g. as the page is not found, the response will always contain the pageIndexed flag. Additionally the methods of PageIndexer that were defined as public to simplify testing are now protected, the tests are adapted accordingly. If you have used this methods, you have to adapt your code. Affected methods: - setupConfiguration - index - indexPage Relates: #3735
- Loading branch information
1 parent
e602789
commit e6a6981
Showing
18 changed files
with
271 additions
and
853 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,6 @@ | ||
"pages",,,,,, | ||
,"uid","is_siteroot","doktype","title","slug","hidden" | ||
,1,1,1,"Hello Search Test","/",0 | ||
"sys_template",,,,,, | ||
,"uid","pid","root","clear","sorting","config", | ||
,1,1,1,3,100," | ||
page = PAGE | ||
page.typeNum = 0 | ||
|
||
plugin.tx_solr { | ||
|
||
enabled = 1 | ||
|
||
index { | ||
fieldProcessingInstructions { | ||
changed = timestampToIsoDate | ||
created = timestampToIsoDate | ||
endtime = timestampToUtcIsoDate | ||
rootline = pageUidToHierarchy | ||
} | ||
|
||
queue { | ||
|
||
// mapping tableName.fields.SolrFieldName => TableFieldName (+ cObj processing) | ||
|
||
pages = 1 | ||
pages { | ||
initialization = ApacheSolrForTypo3\Solr\IndexQueue\Initializer\Page | ||
|
||
// allowed page types (doktype) when indexing pages | ||
allowedPageTypes = 1,7 | ||
|
||
indexingPriority = 0 | ||
|
||
indexer = ApacheSolrForTypo3\Solr\IndexQueue\PageIndexer | ||
indexer { | ||
// add options for the indexer here | ||
} | ||
|
||
// Only index standard pages and mount points that are not overlayed. | ||
additionalWhereClause = (doktype = 1 OR (doktype=7 AND mount_pid_ol=0)) AND no_search = 0 | ||
|
||
fields { | ||
sortSubTitle_stringS = subtitle | ||
} | ||
} | ||
|
||
} | ||
} | ||
}" | ||
"pages", | ||
,"uid","pid","is_siteroot","doktype","slug","title","subtitle","crdate","tstamp" | ||
,2,1,1,1,"/hello_solr","Hello Search Test","the subtitle",1449151778,1449151778 | ||
"tx_solr_indexqueue_item", | ||
,"uid","root","item_type","item_uid","indexing_configuration","changed","indexed","has_indexing_properties","indexing_priority","indexed","errors" | ||
,2,1,"pages",2,"pages",1449151778,0,0,0,0,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,34 @@ | ||
"pages",,,,,,, | ||
,"uid","pid","is_siteroot","doktype","hidden","slug","title" | ||
,1,0,1,1,0,"/","World Hello Search Test" | ||
,2,1,0,1,0,"/improve","Hello you can improve the precision by using phrase configuration World" | ||
,3,1,0,1,0,"/hello-phrase-search-world","Hello phrase search World" | ||
,4,1,0,1,0,"/hello-test-wonderful-world","Hello Test wonderful World" | ||
,5,1,0,1,0,"/hello-wonderful-test-world","Hello wonderful Test World" | ||
,6,1,0,1,0,"/bigram-phrases","Bigraming phrases strip down the sentence to the two-word combinations." | ||
,7,1,0,1,0,"/trigram-phrases","Trigraming phrases strip down the sentence to triplets phrases" | ||
,8,1,0,1,0,"/difference-to-bi-is-tri","Difference to bi is tri, which means building of triplets phrases." | ||
,9,1,0,1,0,"/hello-solr-wolrd","Hello Solr Wolrd" | ||
,10,1,0,1,0,"/hello-test-wolrd","Hello Test Wolrd" | ||
,11,1,0,1,0,"/test-hello-solr-world","Test Hello Solr World" | ||
,12,1,0,1,0,"/test-hello-search-world","Test Hello Search World" | ||
,13,1,0,1,0,"/hello-the-test-search-world","Hello the Test Search World" | ||
,14,1,0,1,0,"/hello-world-for-phrase-searching","Hello World for phrase searching" | ||
,15,1,0,1,0,"/about","Solr is blazing-fast and open source enterprise search platform built on Apache Lucene" | ||
"sys_template",,,,,,, | ||
,"uid","pid","root","clear","sorting","constants","config", | ||
,1,1,1,3,100,""," | ||
page = PAGE | ||
page.typeNum = 0 | ||
|
||
plugin.tx_solr { | ||
search.query.phrase = 1 | ||
enabled = 1 | ||
|
||
index { | ||
fieldProcessingInstructions { | ||
changed = timestampToIsoDate | ||
created = timestampToIsoDate | ||
endtime = timestampToUtcIsoDate | ||
rootline = pageUidToHierarchy | ||
} | ||
|
||
queue { | ||
|
||
// mapping tableName.fields.SolrFieldName => TableFieldName (+ cObj processing) | ||
|
||
pages = 1 | ||
pages { | ||
initialization = ApacheSolrForTypo3\Solr\IndexQueue\Initializer\Page | ||
|
||
// allowed page types (doktype) when indexing pages | ||
allowedPageTypes = 1,7 | ||
|
||
indexingPriority = 0 | ||
|
||
indexer = ApacheSolrForTypo3\Solr\IndexQueue\PageIndexer | ||
indexer { | ||
// add options for the indexer here | ||
} | ||
|
||
// Only index standard pages and mount points that are not overlayed. | ||
additionalWhereClause = (doktype = 1 OR (doktype=7 AND mount_pid_ol=0)) AND no_search = 0 | ||
|
||
fields { | ||
sortSubTitle_stringS = subtitle | ||
} | ||
} | ||
|
||
} | ||
} | ||
}", | ||
,2,1,1,1,0,"/","World Hello Search Test" | ||
,3,1,0,1,0,"/improve","Hello you can improve the precision by using phrase configuration World" | ||
,4,1,0,1,0,"/hello-phrase-search-world","Hello phrase search World" | ||
,5,1,0,1,0,"/hello-test-wonderful-world","Hello Test wonderful World" | ||
,6,1,0,1,0,"/hello-wonderful-test-world","Hello wonderful Test World" | ||
,7,1,0,1,0,"/bigram-phrases","Bigraming phrases strip down the sentence to the two-word combinations." | ||
,8,1,0,1,0,"/trigram-phrases","Trigraming phrases strip down the sentence to triplets phrases" | ||
,9,1,0,1,0,"/difference-to-bi-is-tri","Difference to bi is tri, which means building of triplets phrases." | ||
,10,1,0,1,0,"/hello-solr-wolrd","Hello Solr Wolrd" | ||
,11,1,0,1,0,"/hello-test-wolrd","Hello Test Wolrd" | ||
,12,1,0,1,0,"/test-hello-solr-world","Test Hello Solr World" | ||
,13,1,0,1,0,"/test-hello-search-world","Test Hello Search World" | ||
,14,1,0,1,0,"/hello-the-test-search-world","Hello the Test Search World" | ||
,15,1,0,1,0,"/hello-world-for-phrase-searching","Hello World for phrase searching" | ||
,16,1,0,1,0,"/about","Solr is blazing-fast and open source enterprise search platform built on Apache Lucene" | ||
"tx_solr_indexqueue_item", | ||
,"uid","root","item_type","item_uid","indexing_configuration","changed","indexed","has_indexing_properties","indexing_priority","indexed","errors" | ||
,2,1,"pages",2,"pages",1449151778,0,0,0,0,0 | ||
,3,1,"pages",3,"pages",1449151778,0,0,0,0,0 | ||
,4,1,"pages",4,"pages",1449151778,0,0,0,0,0 | ||
,5,1,"pages",5,"pages",1449151778,0,0,0,0,0 | ||
,6,1,"pages",6,"pages",1449151778,0,0,0,0,0 | ||
,7,1,"pages",7,"pages",1449151778,0,0,0,0,0 | ||
,8,1,"pages",8,"pages",1449151778,0,0,0,0,0 | ||
,9,1,"pages",9,"pages",1449151778,0,0,0,0,0 | ||
,10,1,"pages",10,"pages",1449151778,0,0,0,0,0 | ||
,11,1,"pages",11,"pages",1449151778,0,0,0,0,0 | ||
,12,1,"pages",12,"pages",1449151778,0,0,0,0,0 | ||
,13,1,"pages",13,"pages",1449151778,0,0,0,0,0 | ||
,14,1,"pages",14,"pages",1449151778,0,0,0,0,0 | ||
,15,1,"pages",15,"pages",1449151778,0,0,0,0,0 | ||
,16,1,"pages",16,"pages",1449151778,0,0,0,0,0 |
94 changes: 32 additions & 62 deletions
94
Tests/Integration/Fixtures/Search/phrase_search_bigram.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,38 @@ | ||
"pages",,,,,,, | ||
,"uid","pid","is_siteroot","doktype","hidden","slug","title" | ||
# 100% matching | ||
,1,0,1,1,0,"/","Bigram Phrase Search" | ||
,2,1,1,1,0,"/","Bigram Phrase Search" | ||
# bigram phrase slop = 0 | ||
,2,1,0,1,0,"/dump-sentence","This is some dump sentence to match Bigram Phrase" | ||
,3,1,0,1,0,"/match-phrase-search","This is some dump sentence to match Phrase Search" | ||
,3,1,0,1,0,"/dump-sentence","This is some dump sentence to match Bigram Phrase" | ||
,4,1,0,1,0,"/match-phrase-search","This is some dump sentence to match Phrase Search" | ||
# bigram phrase slop = 1 | ||
,4,1,0,1,0,"/slop-1-bigram-gag-phrase","This is some dump sentence to match slop 1 Bigram gag Phrase" | ||
,5,1,0,1,0,"/slop-1-phrase-gag-search","This is some dump sentence to match slop 1 Phrase gag Search" | ||
,5,1,0,1,0,"/slop-1-bigram-gag-phrase","This is some dump sentence to match slop 1 Bigram gag Phrase" | ||
,6,1,0,1,0,"/slop-1-phrase-gag-search","This is some dump sentence to match slop 1 Phrase gag Search" | ||
# bigram phrase slop = 2 | ||
,6,1,0,1,0,"/slop-2-bigram-gag-gag-phrase","This is some dump sentence to match slop 2 Bigram gag gag Phrase" | ||
,7,1,0,1,0,"/slop-2-phrase-gag-gag-search","This is some dump sentence to match slop 2 Phrase gag gag Search" | ||
,8,1,0,1,0,"/no-docs-match","This is some dump sentence to match no docs" | ||
,9,1,0,1,0,"/no-match","This is some dump sentence to match nothing" | ||
,10,1,0,1,0,"/bphrase-disabled","To disable BPhrase set it to 0." | ||
,11,1,0,1,0,"/match-phrase-only","This is some dump sentence to match Phrase only" | ||
,12,1,0,1,0,"/match-search-only","This is some dump sentence to match Search only" | ||
,13,1,0,1,0,"/match-bigram-only","This is some dump sentence to match Bigram only" | ||
,14,1,0,1,0,"/implicit-bigram-phrase-pf2","Implicit Bigram gag gag gag gag Phrase gag gag gag gag searches in pf2 fields." | ||
,15,1,0,1,0,"/bigram-gag-gag-gag-gag-phrase","Bigram gag gag gag gag Phrase gag gag gag gag Search is fascinating feature." | ||
"sys_template",,,,,,, | ||
,"uid","pid","root","clear","sorting","constants","config", | ||
,1,1,1,3,100,""," | ||
page = PAGE | ||
page.typeNum = 0 | ||
|
||
plugin.tx_solr { | ||
search.query.bigramPhrase = 1 | ||
enabled = 1 | ||
|
||
index { | ||
fieldProcessingInstructions { | ||
changed = timestampToIsoDate | ||
created = timestampToIsoDate | ||
endtime = timestampToUtcIsoDate | ||
rootline = pageUidToHierarchy | ||
} | ||
|
||
queue { | ||
|
||
// mapping tableName.fields.SolrFieldName => TableFieldName (+ cObj processing) | ||
|
||
pages = 1 | ||
pages { | ||
initialization = ApacheSolrForTypo3\Solr\IndexQueue\Initializer\Page | ||
|
||
// allowed page types (doktype) when indexing pages | ||
allowedPageTypes = 1,7 | ||
|
||
indexingPriority = 0 | ||
|
||
indexer = ApacheSolrForTypo3\Solr\IndexQueue\PageIndexer | ||
indexer { | ||
// add options for the indexer here | ||
} | ||
|
||
// Only index standard pages and mount points that are not overlayed. | ||
additionalWhereClause = (doktype = 1 OR (doktype=7 AND mount_pid_ol=0)) AND no_search = 0 | ||
|
||
fields { | ||
sortSubTitle_stringS = subtitle | ||
} | ||
} | ||
|
||
} | ||
} | ||
}" | ||
,7,1,0,1,0,"/slop-2-bigram-gag-gag-phrase","This is some dump sentence to match slop 2 Bigram gag gag Phrase" | ||
,8,1,0,1,0,"/slop-2-phrase-gag-gag-search","This is some dump sentence to match slop 2 Phrase gag gag Search" | ||
,9,1,0,1,0,"/no-docs-match","This is some dump sentence to match no docs" | ||
,10,1,0,1,0,"/no-match","This is some dump sentence to match nothing" | ||
,11,1,0,1,0,"/bphrase-disabled","To disable BPhrase set it to 0." | ||
,12,1,0,1,0,"/match-phrase-only","This is some dump sentence to match Phrase only" | ||
,13,1,0,1,0,"/match-search-only","This is some dump sentence to match Search only" | ||
,14,1,0,1,0,"/match-bigram-only","This is some dump sentence to match Bigram only" | ||
,15,1,0,1,0,"/implicit-bigram-phrase-pf2","Implicit Bigram gag gag gag gag Phrase gag gag gag gag searches in pf2 fields." | ||
,16,1,0,1,0,"/bigram-gag-gag-gag-gag-phrase","Bigram gag gag gag gag Phrase gag gag gag gag Search is fascinating feature." | ||
"tx_solr_indexqueue_item", | ||
,"uid","root","item_type","item_uid","indexing_configuration","changed","indexed","has_indexing_properties","indexing_priority","indexed","errors" | ||
,2,1,"pages",2,"pages",1449151778,0,0,0,0,0 | ||
,3,1,"pages",3,"pages",1449151778,0,0,0,0,0 | ||
,4,1,"pages",4,"pages",1449151778,0,0,0,0,0 | ||
,5,1,"pages",5,"pages",1449151778,0,0,0,0,0 | ||
,6,1,"pages",6,"pages",1449151778,0,0,0,0,0 | ||
,7,1,"pages",7,"pages",1449151778,0,0,0,0,0 | ||
,8,1,"pages",8,"pages",1449151778,0,0,0,0,0 | ||
,9,1,"pages",9,"pages",1449151778,0,0,0,0,0 | ||
,10,1,"pages",10,"pages",1449151778,0,0,0,0,0 | ||
,11,1,"pages",11,"pages",1449151778,0,0,0,0,0 | ||
,12,1,"pages",12,"pages",1449151778,0,0,0,0,0 | ||
,13,1,"pages",13,"pages",1449151778,0,0,0,0,0 | ||
,14,1,"pages",14,"pages",1449151778,0,0,0,0,0 | ||
,15,1,"pages",15,"pages",1449151778,0,0,0,0,0 | ||
,16,1,"pages",16,"pages",1449151778,0,0,0,0,0 |
Oops, something went wrong.