Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qiuhaotc/CodeIndex

A Code Index Searching Tools Based On Lucene.Net
https://github.com/qiuhaotc/CodeIndex

asp-net-core blazor csharp full-text-search fulltext-indexes fulltext-search fulltextsearch lucene searching

Last synced: 2 months ago
JSON representation

A Code Index Searching Tools Based On Lucene.Net

Awesome Lists containing this project

README

        

# Code Index

A fast full-text searching tools based on Lucene.Net

## Feature

1. Support multiple indexes
2. Auto monitoring indexed files changes
3. Support various search (etc: fuzzy, wildcard, case-sensitive) on file content, name, location, extension
4. Support Docker
5. Support Visual Studio

## Demonstrate Site

[https://coderindex.azurewebsites.net/](https://coderindex.azurewebsites.net/)

## Guide

### Run On Your Local

#### Config

Go to CodeIndex.Server => appsettings.json

LuceneIndex => To your local empty folder, this folder will be going to store the index files and configuration files.

ManagerUsers => Config the users name, id, password that can management the indexes.

```json
"CodeIndex": {
"LuceneIndex": "D:\\TestFolder\\Index",
"IsInLinux": "false",
"MaximumResults": 10000,
"ManagerUsers": [
{
"Id": 1,
"UserName": "Admin",
"Password": "CodeIndex"
}
]
}
```

#### Run Server

Set CodeIndex.Server as the start up project, compile the project

Run it via visual studio or bash

```bash
dotnet CodeIndex.Server.dll --urls "http://:5000;https://:5001"
```

#### Config Indexes

In this page, you can add/remove/delete and config the index folder you want to monitoring and searching.

![Config Indexes](https://raw.githubusercontent.com/qiuhaotc/CodeIndex/master/doc/ConfigAndSearching.gif)

#### Doing Search

##### Search By Files

It will return the matched infos with highlight in the whole file

![Search By Files](https://raw.githubusercontent.com/qiuhaotc/CodeIndex/master/doc/SearchByFiles.gif)

##### Search By Lines

It will return the matched infos with highlight and matched line number

![Search By Lines](https://raw.githubusercontent.com/qiuhaotc/CodeIndex/master/doc/SearchByLines.gif)

### Run With Docker

Support docker container, [Docker hub](https://hub.docker.com/r/qiuhaotc/codeindex)

#### Docker Command Format

```bash
docker pull qiuhaotc/codeindex
docker run -d --name codeindex -p 8080:8080 -v "Your index folder":/luceneindex -v "Your code folder":/monitorfolder -v "Your logs folder":/app/Logs -e CodeIndex__MonitorFolderRealPath="Your real folder path" -e CodeIndex__ManagerUsers__0__UserName="Your Management User Name" -e CodeIndex__ManagerUsers__0__Password="Your Management Password" --restart=always qiuhaotc/codeindex
```

##### Example

```bash
docker pull qiuhaotc/codeindex
docker run -d --name codeindex -p 8080:8080 -v /home/user/luceneindex:/luceneindex -v /home/user/codefolder:/monitorfolder -v /home/user/logs:/app/Logs -e CodeIndex__MonitorFolderRealPath="/home/user/codefolder" -e CodeIndex__ManagerUsers__0__UserName="Test" -e CodeIndex__ManagerUsers__0__Password="Dummy" --restart=always qiuhaotc/codeindex
```

Notice: in the docker container, when add the index config, the monitor folder should replace the actual path to start with "/monitorfolder", like the actually path is "/home/user/codefolder/mysourceA", the monitor folder should be "/monitorfolder/mysourceA"

### Search Extension For Visual Studio

|Status|Value|
|:----|:---:|
|VS Marketplace|[![VS Marketplace](http://vsmarketplacebadge.apphb.com/version-short/qiuhaotc.CodeIndexExtension.svg)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)
|VS Marketplace Downloads|[![VS Marketplace Downloads](http://vsmarketplacebadge.apphb.com/downloads/qiuhaotc.CodeIndexExtension.svg)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)
|VS Marketplace Installs|[![VS Marketplace Installs](http://vsmarketplacebadge.apphb.com/installs-short/qiuhaotc.CodeIndexExtension.svg)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)

#### Download Url

[Code Index Extension](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)

#### Search Code

1. Open the code index search window under: view => other window => code index search
2. Config the service url to your own service
3. Doing the search

![Code Index Search Extension](https://raw.githubusercontent.com/qiuhaotc/CodeIndex/master/doc/UseExtension.gif)

### Search Syntax

#### Phase Query

When Phase Query been ticked, we can search the content via the query like: str*ng abc, it will give the result such as "string abc", "strdummyng abc" as the search results, the results like "abc string" or "stng abc" won't return.

In Phase Query mode, currently only support wildcard matching for word like stri*, organi*tion

![Phase Query Search](https://raw.githubusercontent.com/qiuhaotc/CodeIndex/master/doc/PhaseQuerySearch.gif)

When Phase Quuery not been ticked, you can follow the sytax under [http://www.lucenetutorial.com/lucene-query-syntax.html](http://www.lucenetutorial.com/lucene-query-syntax.html) to doing the search

#### Case-Sensitive

When Case-Sensitive been ticked, we can search the content in case-sensitive mode. When search the content like String, it won't return the content that contains string

## Misc

|Status|Value|
|:----|:---:|
|Stars|[![Stars](https://img.shields.io/github/stars/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|Forks|[![Forks](https://img.shields.io/github/forks/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|License|[![License](https://img.shields.io/github/license/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|Issues|[![Issues](https://img.shields.io/github/issues/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|Docker Pulls|[![Downloads](https://img.shields.io/docker/pulls/qiuhaotc/codeindex.svg)](https://hub.docker.com/r/qiuhaotc/codeindex)
|Release Downloads|[![Downloads](https://img.shields.io/github/downloads/qiuhaotc/CodeIndex/total.svg)](https://github.com/qiuhaotc/CodeIndex/releases)