File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
antora-ui-camel/src/js/vendor Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 33
44 const algoliasearch = require ( 'algoliasearch/lite' )
55
6+ // Sub-projects to exclude from main search - users can browse these directly
7+ const EXCLUDED_SUBPROJECTS = [
8+ '/camel-k/' ,
9+ '/camel-quarkus/' ,
10+ '/camel-spring-boot/' ,
11+ '/camel-kafka-connector/' ,
12+ '/camel-kamelets/' ,
13+ '/camel-karaf/' ,
14+ ]
15+
16+ // Check if a URL belongs to a sub-project that should be filtered out
17+ function isSubProjectUrl ( url ) {
18+ if ( ! url ) return false
19+ return EXCLUDED_SUBPROJECTS . some ( function ( subproject ) {
20+ return url . indexOf ( subproject ) !== - 1
21+ } )
22+ }
23+
624 window . addEventListener ( 'load' , ( ) => {
725 const client = algoliasearch ( 'V62SL4FFIW' , '1b7e52df4759e32dd49adedb286997f6' )
826 const index = client . initIndex ( 'apache_camel' )
4664 cancel . style . display = 'block'
4765 index
4866 . search ( search . value , {
49- hitsPerPage : 5 ,
67+ hitsPerPage : 10 ,
5068 } )
5169 . then ( ( results ) => {
52- const hits = results . hits
53- const data = hits . reduce ( ( data , hit ) => {
70+ // Filter out sub-project results to focus on camel-core documentation
71+ const filteredHits = results . hits . filter ( function ( hit ) {
72+ return ! isSubProjectUrl ( hit . url )
73+ } ) . slice ( 0 , 5 )
74+ const data = filteredHits . reduce ( ( data , hit ) => {
5475 const section = hit . hierarchy . lvl0
5576 const sectionKey = `${ section } -${ hit . version || '' } `
5677
You can’t perform that action at this time.
0 commit comments