Menu
  • HOME
  • TAGS

ElasticSearch Service - Centos 7 - How to view console

Tag: command-line,elasticsearch,centos,kibana,centos7

So I have successfully installed and started ElasticSearch as a service in Centos 7. My question is this. After the service is started, is there a way to view the console that one would see if it didn't start ElasticSearch as a service?

An example of the console I am trying to see is below:(This is what it would have looked like if I didn't start it as a service).

Elastic Search - When Starting Normally

Best How To :

Once you have started elasticsearch on console, you can check whether elasticsearch is running or not by entering following url in browser: http://localhost:9200

By entering above url if you get a response such as:

{
 "status" : 200,
  "name" : "Doppelganger",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.5.2",
    "build_hash" : "62ff9868b4c8a0c45860bebb259e21980778ab1c",
    "build_timestamp" : "2015-04-27T09:21:06Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

It means your elasticsearch is working.

Note: If you are not running elasticsearch instance & enter the url you will find webpage is not available message.

Bad scoring due to different maxDocs of IDF

elasticsearch

The default search type is query_then_fetch . Both query_then_fetch and query_and_fetch involve calculating the term and document frequency local to each of the shards in the index. However if you want a more accurate calculation of term/document frequency one can use dfs_query_then_fetch/dfs_query_and_fetch .Here the frequency is calculated across all the...

Operator '??' cannot be applied to operands of type IQueryContainer and lambda expression

c#,elasticsearch,nest

Thanks to the comment of @Mrinal Kamboj and the answer of @Wormbo, I found my own answer: I changed the argument type to QueryContainer and if the argument is null, a new QueryMatchAll query is created, this works for me: public void ProcessQuery(QueryContainer query = null) { var searchResult =...

How to write search queries in kibana using Query DSL for Elasticsearch aggregation

elasticsearch,querydsl,kibana-4

I am not sure you can do this as the Discovery section already uses the timestamp aggregation. Can you explain what are you trying to do? There are ways to add customer aggregations in the visualizations. If you open up the advanced section on the aggregation in the visualization you...

Elasticsearch - Query document missing an array value

elasticsearch

Try this (with lowercase value for the terms bool): { "query": { "bool": { "must": [ { "match_all": {} } ], "must_not": { "terms": { "interdictions": [ "s2v" ] } } } }, "from": 0, "size": 10 } Most probably, you have an analyzer (maybe the standard default one) that...

running testng.xml via command line- error Cannot find class in classpath: com.companyname.SSProject.LaunchSSProject

command-line,testng

Try the following command: C:\SSProject> java -cp "path/to/your/jar/testng.jar:path/to/your/test_classes" org.testng.TestNG testng.xml If your testng.xml is not in C:\SSProject than give the full path to the testng.xml. SO user Patton has explained this very nicely here - How to run TestNG from DOS Prompt Updated: For windows user, following command worked -...

ElasticSearch REST - insert JSON string without using class

elasticsearch,elastic,elasticsearch-net

You can use low level client to pass raw json. var elasticsearchClient = new Elasticsearch.Net.ElasticsearchClient(settings); var elasticsearchResponse = elasticsearchClient.Index("index", "type", "{\"UserID\":1,\"Username\": \"Test\",\"EmailID\": \"[email protected]\"}"); UPDATE Based on documentation, try this one: var sb = new StringBuilder(); sb.AppendLine("{ \"index\": { \"_index\": \"indexname\", \"_type\": \"type\" }}"); sb.AppendLine("{ \"UserID\":1, \"Username\": \"Test\", \"EmailID\": \"[email protected]\" }");...

Using the Rails console to delete odd-numbered records

ruby-on-rails-4,command-line,console

You can use Hero.where('id MOD(2)!=0').destroy_all ...

Get elasticsearch result based on two keys

elasticsearch,elastic

You need a query_string not a match: { "query": { "query_string": { "query": "PayerAccountId:\"156023466485\" AND UsageStartDate:[2015-01-01 TO 2015-10-01]" } } } ...

Elasticsearch boost per field with function score

elasticsearch,lucene,solr-boost

The _boost field (document-level boost) was removed, but field-level boosts, and query boosts still work just fine. It looks like you are looking for query boosts. So, if you wanted to boost matches on field1: "bool": { "should": [{ "terms": { "field1": ["67", "93", "73", "78", "88", "77"], "boost": 2.0...

ElasticSearch- “No query registered for…”

search,indexing,elasticsearch

Write your query like this, i.e. sort needs to go to the top-level and not nested in the querypart: { "query": { "filtered": { "query": { "query_string": { "fields": [ "description" ], "query": "sun" } }, "filter": { "term": { "permissions": 1 } } } }, "sort": [ { "likes_count":...

How do I silence the HEAD of a curl request while using the silent flag?

bash,shell,curl,command-line,pipe

Try this: curl --silent "www.site.com" > file.txt ...

Docker container http requests limit

http,elasticsearch,docker

So, it wasn't a problem with either Docker or Elastic. Just to recap, the same script throwning PUT requests at a Elasticsearch setup locally worked, but when throwning at a container with Elasticsearch failed after a few thousand documents (20k). To note that the overal number of documents was roughtly...

Gradle Assemble Debug is Successful But Does Not Work [duplicate]

android,command-line,gradle

Look for build outputs under the app module. app/build/outputs/...

Re-index object with new fields

elasticsearch,nest

if you want to update you can do this: var response = _Instance.Update<BusinessElastic, object>(u => u .Index(elasticSearchIndex) .Type("business") .Id(result.Hits.FirstOrDefault().Id) .Doc(new Document {Column1="", Column2=""}) .DocAsUpsert() ); ...

How to use arrays in lambda expressions?

c#,elasticsearch,nest

The params keyword in C# indicates that the method takes a variable number of parameters. For example, a method with this signature: public void DoStuff(params string[] values) { ... } Could be called like this: DoStuff(); DoStuff("value1"); DoStuff("value1", "value2", "value3", "value4", "value5"); //etc. So in your case, the array is...

AWK count number of times a term appear with respect to other columns

linux,shell,command-line,awk,sed

Almost same as the other answer, but printing 0 instead of blank. AMD$ awk -F, 'NR>1{a[$2]+=$3;b[$2]++} END{for(i in a)print i, a[i], b[i]}' File pear 1 1 apple 2 3 orange 0 1 peach 0 1 Taking , as field seperator. For all lines except the first, update array a. i.e...

Taking multiple header (rows matching condition) and convert into a column

bash,perl,command-line,awk,sed

In awk awk -F, 'NF==1{a=$0;next}{print a","$0}' file Checks if the number of fields is 1, if it is it sets a variable to that and skips the next block. For each line that doesn't have 1 field, it prints the saved variable and the line And in sed sed -n...

elasticsearch aggregation group by null key

elasticsearch

I don't think you can do this with terms. Try with another aggregation: { "aggs": { "myAggrs": { "terms": { "field": "system" } }, "missing_system": { "missing": { "field": "system" } } } } And the result will be: "aggregations": { "myAggrs": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ {...

command line Start.Info.Argument error

c#,command-line,wix,heat

Usually, path environments (%windir%, %temp%, etc) uses backslashes (\). try modifying your arguments to use backslashes instead of slashes (\"%WIX% \ bin \ heat.exe\"...

Query returns both documents instead of just one

c#,.net,elasticsearch,nest

term filters don't analyze the text to be searched. Meaning, if you search for 000A8D810F5A, this is exactly what is searching for (upper-case letters included). But, your macAddr and insturmentName fields and others are just strings. Meaning, they use the standard analyzer which lowercases the terms. So, you are searching...

How to release binaries on Github for different plattforms as seperate downloads?

git,github,command-line,software-distribution

All Releases are tied to Git tags. You can either choose an existing tag, or let GitHub create a new tag from an existing branch when the Release is created. You can create releases and attach one or more artifacts (e.g., your binaries) via the GitHub API; see the docs...

Continuous data stream from linux command line into python script

python,linux,command-line,tcp,pipe

Would pipes and stdin work? Here is a similar question just asked a couple minutes ago. Reading from linux command line with Python...

Not able to access Kibana running in a Docker container on port 5601

elasticsearch,docker,dockerfile,kibana-4

The parent Dockerfile devdb/kibana is using a script to start kibana and elasticsearch when the docker container is started. See CMD ["/sbin/my_init"] and the script itself. When in your own Dockerfile you use the CMD instruction, you override the one from the parents Dockerfiles. Since your CMD only starts gunicorn,...

MultiMatch query with Nest and Field Suffix

c#,elasticsearch,nest

Did you try to use extension method Suffix? This is how you can modify your query: ... .OnFields( f => f.ScreenData.First().ValueString, f => f.ScreenData.First().ValueString.Suffix("english")) .Type(TextQueryType.BestFields) ... Hope it helps....

Running Rscript in command line and loading packages

r,command-line,packages,rscript

For future references, you could use function require instead of library to avoid this error: require just returns FALSE and raises a warning if the package is not installed instead of throwing an error. You can therefore do a construct as follows: if(!require(ggplot2)){install.packages("ggplot2")} What it does is trying to load...

Elasticsearch NumberFormatException when running two consecutive java tests

java,date,elasticsearch,numberformatexception,spring-data-elasticsearch

Since the exception complains about a NumberFormatException, you should try sending the date as a long (instead of a Date object) since this is how dates are stored internally. See I'm calling date.getTime() in the code below: SearchQuery searchQuery = new NativeSearchQueryBuilder() .withQuery(matchAllQuery()) .withFilter(rangeFilter("publishDate").lt(date.getTime())).build(); ...

How to have multiple regex based on or condition in elasticsearch?

elasticsearch

Use a should instead of a must: { "fields": [ "host" ], "filter": { "bool": { "should": [ { "regexp": { "_uid": { "value": ".*000ANT.*" } } }, { "regexp": { "_uid": { "value": ".*0BBNTA.*" } } } ] } } } ...

How to read data in logs using logstash?

elasticsearch,logstash

You can use the following pattern for the same %{GREEDYDATA}\[name:%{WORD:name};%{GREEDYDATA},acc:%{NOTSPACE:account}\] GREEDYDATA us defined as follows - GREEDYDATA .* The key lie in understanding greedydata macro. It eats up all possible characters as possible....

How to compute the scores based on field data in elasticsearch

elasticsearch

You can achieve this by using scripting. Try the script below: { "query": { "function_score": { "functions": [ { "script_score": { "script": "_score * doc['bodyWeight'].value / doc['height'].value" } } ], "score_mode": "sum", "boost_mode": "replace" } } } Like wise you can compute score using field data. For more reference in...

If exist and errorlevels in a batch (.bat) file

windows,batch-file,command-line

Try this : REM if SqlCmd command is successful run the below if exist statement if "%ERRORLEVEL%"=="0" ( REM if the file exists then delete and exit: if exist "D:\Temp\database.bak" ( del "D:\Temp\database.bak" exit /B ) else ( REM if the file doesn't exist, exit with error code 1: echo...

NEST - Using GET instead of POST/PUT for searching

c#,elasticsearch,nest

Yes https://github.com/elastic/elasticsearch-net/blob/develop/src/Nest/DSL/SearchDescriptor.cs line number 135 public static void Update(IConnectionSettingsValues settings, ElasticsearchPathInfo<SearchRequestParameters> pathInfo, ISearchRequest request) { pathInfo.HttpMethod = request.RequestParameters.ContainsKey("source") ? PathInfoHttpMethod.GET : PathInfoHttpMethod.POST; } Obviously you need to have SearchRequest.RequestParameters.ContainsKey("source") return true for it to do a Get. In future. Just RTFM....

Set Java path in command line for only one directory

java,command-line,command-prompt

If the program uses a batch to start, then add this line before the start of the program: SET JAVA_HOME="C:\Program Files\Java7\Java.exe" (This is just an example, the directory might be different on your computer) If the program does not use such a batch (you can recognize it because it ends...

Javascript: Altering an object where dot notation is used [duplicate]

javascript,jquery,elasticsearch

This is because the binding you've used (i.e., 'terms.region.slug') is incompatible with dot-notation. Use of dot-notation requires that the binding be parseable as an identifier. However, bracket notation is equivalent to dot-notation and allows any binding to be used. console.log( filter.and[0].term['terms.region.slug'] );...

Elasticsearch and C# - query to find exact matches over strings

c#,.net,database,elasticsearch,nest

You can use filtered query with term filter: { "filtered": { "query": { "match_all": { } }, "filter": { "bool" : { "must" : [ {"term" : { "macaddress" : "your_mac" } }, {"term" : { "another_field" : 123 } } ] } } } } NEST version (replace dynamic...

Parsing Google Custom Search API for Elasticsearch Documents

json,python-2.7,elasticsearch,google-search-api

here is a possible answer to your problem. def myfunk( inHole, outHole): for keys in inHole.keys(): is_list = isinstance(inHole[keys],list); is_dict = isinstance(inHole[keys],dict); if is_list: element = inHole[keys]; new_element = {keys:element}; outHole.append(new_element); if is_dict: element = inHole[keys].keys(); new_element = {keys:element}; outHole.append(new_element); myfunk(inHole[keys], outHole); if not(is_list or is_dict): new_element = {keys:inHole[keys]}; outHole.append(new_element);...

Using a command-line utility to perform the following map-updates

shell,command-line,awk,terminal

If order is not important, join and awk can do the job easily. $ join <(sort input.txt) <(sort mapping.txt) | awk -v OFS="|" '{for (i=3;i<NF;i++) print $2, $i OFS}' 103823054|001| 103823044|011| 103823044|012| 103823044|013| 103823064|011| 103823064|012| 103823064|013| ...

How to get duplicate field values in elastic search by field name without knowing its value

elasticsearch

You can use Terms Aggregation for this. POST <index>/<type>/_search?search_type=count { "aggs": { "duplicateNames": { "terms": { "field": "EmployeeName", "size": 0, "min_doc_count": 2 } } } } This will return all values of the field EmployeeName which occur in at least 2 documents....

How to set the classpath in Windows Command Line correctly

java,windows,command-line,classnotfoundexception

You have add the JAR to the CLASSPATH, not the folder which contains this JAR. So the -cp argument should something be like this C:\Users\ANNA\Downloads\SimplifiedConnectionProvider.jar;C:\Users\ANNA\Downloads\Windows64_Libjitsi\the_name_of_the_JAR.jar.

cat /dev/null to multiple files to clear existing files like logs

linux,bash,shell,command-line,tee

Hard coded solutions tee Echo nothing and simple send it to multiple files using the tee command. Like this: $ echo -n | tee file1 file2 file3 file4 file5 All files in that list will be empty and created if they don't exist. Applied to your answer this would be:...

Elasticsearch standard analyser stopwords

elasticsearch

This would be the list of stopwords for the standard analyzer: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.lucene/lucene-analyzers-common/4.9.0/org/apache/lucene/analysis/core/StopAnalyzer.java?av=f#50 50 static { 51 final List<String> stopWords = Arrays.asList( 52 "a", "an", "and", "are", "as", "at", "be", "but", "by", 53 "for", "if", "in", "into", "is", "it", 54 "no", "not", "of", "on", "or", "such", 55 "that", "the", "their", "then",...

How to uninstall a program using C#? [duplicate]

c#,visual-studio,visual-studio-2012,command-line,windows-installer

You've asked with a Windows Installer tag, so if we are talking about products installed from MSI files: Attempt 1 is incorrect because Windows Installer doesn't use the uninstallstring to uninstall products (change it and see if it makes a difference), and there are better ways. 2 uses WMI, and...

Get document on some condition in elastic search java API

java,elasticsearch,elasticsearch-plugin

When indexing documents in this form, Elasticsearch will not be able to parse those strings as dates correctly. In case you transformed those strings to correctly formatted timestamps, the only way you could perform the query you propose is to index those documents in this format { "start": "2010-09", "end":...

Elasticsearch: How to query using partial phrases in quotation marks

elasticsearch

query_string will do just this. { "query": { "query_string": { "query": "example \"hello world\" elasticsearch", "default_operator": "AND" } } } ...

ElasticSearch - Configuration to Analyse a document on Indexing

elasticsearch

Elasticsearch is "near real-time" by nature, i.e. all indices are refreshed every second (by default). While it may seem enough in a majority of cases, it might not, such as in your case. If you need your documents to be available immediately, you need to refresh your indices explicitly by...

Strange behaviour of limit in Elasticsearch

python,elasticsearch

The limit filter doesn't limit the number of documents that are returned, just the number of documents that the query executes on each shard. If you want to limit the number of documents returned, you need to use the size parameter or in your case the Python slicing API like...

elastic search sort in aggs by column

sorting,elasticsearch,group-by,order

Edit to reflect clarification in comments: To sort an aggregation by string value use an intrinsic sort, however sorting on non numeric metric aggregations is not currently supported. "aggs" : { "order_by_title" : { "terms" : { "field" : "title", "order": { "_term" : "asc" } } } } ...

Increment Serial Number using EXIF

windows,powershell,command-line,exif,exiftool

You'll probably have to go to the command line rather than rely upon drag and drop as this command relies upon ExifTool's advance formatting. Exiftool "-SerialNumber<001-001-0001-${filesequence;$_=sprintf('%04d', $_+1 )}" <FILE/DIR> If you want to be more general purpose and to use the original serial number in the file, you could use...

NEST ElasticSearch.NET Escape Special Characters

c#,elasticsearch,nest

You will need to setup a multifield as the dash is causing the terms to be split. I have found an answer to a similar question which answers yours: http://stackoverflow.com/a/28859145/4134821

Elasticsearch geospatial search, problems with index setup

elasticsearch,geospatial

There are a couple issues in your code: Issue 1: When you create your document in the second snippet, you're not using the correct mapping type and your body doesn't include the correct field name as declared in your mapping: client.create({ index: 'events', type: 'geo_point', <-------- wrong type body: {...

ElasticSearch asynchronous post

database,post,asynchronous,elasticsearch,get

To ensure data is available, you can make a refresh request to corresponding index before GET/SEARCH: http://localhost:9200/your_index/_refresh Or refresh all indexes: http://localhost:9200/_refresh ...