Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fessctl ping # reports the search engine status (GREEN when ready)

### Register a Repository

Create a Git data store config for each repository you want to index. The `handler-script` maps Git metadata to the codesearch fields (`organization`, `repository`, `filetype`, …) that power the search facets. Replace `codelibs` / `fess-suggest` / `master` with your own organization, repository, and default branch:
Create a Git data store config for each repository you want to index. The `handler-script` maps Git metadata to the codesearch fields (`organization`, `repository`, `filetype`, …) that power the search facets. Replace `codelibs` / `fess-suggest` / `master` with your own organization, repository, and default branch. Set `commit_id` explicitly to that branch — left at the GitDataStore default (`HEAD`), the plugin's own HEAD-resolution fallback can fail against GitHub for repositories whose default branch isn't literally `master`:

```bash
fessctl dataconfig create \
Expand All @@ -99,7 +99,8 @@ fessctl dataconfig create \
base_url=https://github.com/codelibs/fess-suggest/blob/master/
extractors=text/.*:textExtractor,application/xml:textExtractor,application/javascript:textExtractor,application/json:textExtractor,application/x-sh:textExtractor,application/x-bat:textExtractor,audio/.*:filenameExtractor,chemical/.*:filenameExtractor,image/.*:filenameExtractor,model/.*:filenameExtractor,video/.*:filenameExtractor,
delete_old_docs=false
repository_path=/home/fess/workspace/fess-suggest' \
repository_path=/home/fess/workspace/fess-suggest
commit_id=master' \
--handler-script 'url=url
host="github.com"
site="github.com/codelibs/fess-suggest/" + path
Expand Down
7 changes: 6 additions & 1 deletion bin/register_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,16 @@ for s in d.get("response", {}).get("settings", []):
break
' "$name" || true)

# commit_id pins the checkout to the detected branch explicitly. Left at the
# GitDataStore default ("HEAD"), the plugin's own HEAD-resolution fallback can
# fail against GitHub (protocol v2 sometimes doesn't advertise a HEAD symref),
# breaking every repo whose default branch isn't literally "master".
handler_parameter="uri=${git_url}
base_url=${base_url}
extractors=text/.*:textExtractor,application/xml:textExtractor,application/javascript:textExtractor,application/json:textExtractor,application/x-sh:textExtractor,application/x-bat:textExtractor,audio/.*:filenameExtractor,chemical/.*:filenameExtractor,image/.*:filenameExtractor,model/.*:filenameExtractor,video/.*:filenameExtractor,
delete_old_docs=false
repository_path=/home/fess/workspace/${repo}"
repository_path=/home/fess/workspace/${repo}
commit_id=${branch}"

handler_script="url=url
host=\"${domain}\"
Expand Down