Giter VIP home page Giter VIP logo

dexer's Introduction

File Indexer Build Status

This is a simple project which reads files in the directory mentioned in the config file and indexes it. This then can be used to search the files present in the directory.

Motivation

This is a way of trying to index the logs file in dgplug so that we can easily find the files in which a word has occured in the file.

Dependency

This assumes that you have Go installed and setup.

pip3 and python3 is what we need for development purpose.

How to install

Note : Right now we are unable to provide binary builds, so have to build the program the regular way or you can build a docker container.

  1. Install git.
  2. Install Go (need a version which supports Go Modules).
  3. Run the following commands :
$ git clone https://github.com/dgplug/dexer.git
$ cd dexer
$ make all
$ dexer

To use the program we need a configuration file which is provided by the config.json file. Here is an example of one:

{
    "RootDirectory": "logs",
    "IndexFilename": "irclogs.bleve",
    "Port": ":8000",
    "LogFile": "logfile"
}

There are 4 entries :

  • RootDirectory : Location of the logs which we want to search through.
  • IndexFilename : The file where bleve will store all the information related to indexing.
  • Port : The port on which the server will be run.
  • LogFile : The file which will be used to store the logs.

API

Once everything is working fine install the postman plugin for your browser. And from that plugin you need to hit the endpoint as:

localhost:<port>/search/american

Here, port number passed to the program using the configuration file ,american is the query word that I passed, make sure to open any file in the logs/ directory and find a word to search. It will look like this:

Missing screenshot

Use the Web Front End

You can also visit localhost:<port> to use the web frontend which comes with the program to search.

Web Front End

Run locally using docker

You can run the application using Docker in your local machine. It will use the Dockerfile instructions. Make sure you have Docker installed in your machine.

Run the following commands to build and run the docker image.

$ git clone https://github.com/dgplug/dexer.git
$ cd dexer
$ make logs
$ make docker-build # builds docker image
$ make docker-run # runs the image in new container

One has to make sure the logs directory has all the file because dexer runs the indexing at the starting and then keeps it, so if a file is not there it would not index it.

dexer's People

Contributors

ashwani99 avatar farhaanbukhsh avatar hellozee avatar sayanchowdhury avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dexer's Issues

Test cases

There are no test cases yet each function has to have test cases.

Add a CONTRIBUTING.md

We need a contributing guide for helping out people who want to contribute to the project

Containerize the app

We need to put this in a container so that we are able to deploy this easily.

Idea for static searching

Can we have something like this?

The whole search portal will be a web-app,so processing can take place within the user's browser.
Every log.txt will have tags in the last line, that will be extracted by the CI builder and appended to a tags.JSON like

{ 
'23-08-2018`: ['git','session 2','mentor1'],
'25-08-2018`: ['git','session 3','mentor1'],
}

Then, we will have another links.JSON built by CI, like

{
'23-08-2018': 'https:link/to/log/file`,
'25-08-2018': 'https:link/to/log/file`,
}

then, these files can be loaded in the browser, and JS will match the relevant tags and show the links to relevant log files!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.