Solr unable to search on fields? - docker-compose

I have installed Solr as a docker image and can create cores and upload some test JSON.
I then want to search on this, but I can't, in this case I want to find the id where it matches. I enter the q filter text and then hit execute but it still lists all the json results! what am I missing?
I can query it in a url as follows though!? so seems like the front end is messed up somehow?

I believe the issue was in my docker-compose.yml file, I had these extra lines which seem to cause this issue, redoing the instance without this, I can happily query the data.
command:
- solr-precreate
- gettingstarted

Related

Expression {{current_username()}} is not being read properly by Superset row level security with Postgres

I have been trying to add Row Level Security to Superset and I have written this clause:
when I hard code this clause in a select on the database it works as it should but when I try to dynamically call current_username() it does not read it properly.
This is what happens when I call current_username() on sqlLab:
I am currently using Superset 0.999.0dev on docker, and I am connecting to a Postgres Database.
I figured it out! Basically what you need to do is follow this guide to get the docker image directly from github.
Once you have cloned the project, find the folder where the project is saved and look for docker/pythonpath/superset_config.py and, inside this file, place "ENABLE_TEMPLATE_PROCESSING":True inside FEATURE_FLAGS like so.
Once you are done editing the file you should be able to run the docker-compose command. FYI, it takes a little while to fully load.

Can I debug a PostgreSQL query sent from an external source, that I can't edit?

I see how to debug queries stored as Functions in the database. But my problem is with an external QGIS plugin that connects to my Postgres 10.4 via network and does a complex query and calculations, and stores the results back into PostGIS tables:
FOR r IN c LOOP
SELECT
(1 - ST_LineLocatePoint(path.geom, ST_Intersection(r.geom, path.geom))) * ST_Length(path.geom)
INTO
station
(continues ...)
When it errors, it just returns that line number as the failing location, but no clue where it was in the loop through hundreds of features. (And any features it has processed are not stored to the output tables when it fails.) I totally don't know enough about the plugin and about SQL to hack the external query, and I suspect if it was a reasonable task the plugin author would have included more revealing debug messages.
So is there some way I could use pgAdmin4 (or anything) from the server side to watch the query process? Even being able to see if it fails the first time through the loop or later would help immensely. Knowing the loop count at failure would point me to the exact problem feature. Being able to see "station" or "r.geom" would make it even easier.
Perfectly fine if the process is miserably slow or interferes with other queries, I'm the only user on this server.
This is not actually a way to watch the RiverGIS query in action, but it is the best I have found. It extracts the failing ST_Intersects() call from the RiverGIS code and runs it under your control, where you can display any clues you want.
When you're totally mystified where the RiverGIS problem might be, run this SQL query:
SELECT
xs."XsecID" AS "XsecID",
xs."ReachID" AS "ReachID",
xs."Station" AS "Station",
xs."RiverCode" AS "RiverCode",
xs."ReachCode" AS "ReachCode",
ST_Intersection(xs.geom, riv.geom) AS "Fraction"
FROM
"<your project name>"."StreamCenterlines" AS riv,
"<your project name>"."XSCutLines" AS xs
WHERE
ST_Intersects(xs.geom, riv.geom)
ORDER BY xs."ReachID" ASC, xs."Station" DESC
Obviously replace <your project name> with the QGIS project name.
Also works for the BankLines step if you replace "StreamCenterlines" with "BankLines". Probably could be adapted to other situations where ST_Intersects() fails without a clue.
You'll get a listing with shorter geometry strings for good cross sections and double-length strings for bad ones. Probably need to widen your display column a lot to see this.
Works for me in pgAdmn4, or in QGIS3 -> Database -> DB Manager -> (click the wrench icon). You could select only bad lines, but I find the background info helpful.

Jmeter - Can I change a variable halfway through runtime?

I am fairly new to JMeter so please bear with me.
I need to understand whist running a JMeter script I can change the variable with the details of "DB1" to then look at "DB2".
Reason for this is I want to throw load at a MongoDB and then switch to another DB at a certain time. (hotdb/colddb)
The easiest way is just defining 2 MongoDB Source Config elements pointing to separate database instances and give them 2 different MongoDB Source names.
Then in your script you will be able to manipulate MongoDB Source parameter value in the MongoDB Script test element or in JSR223 Samplers so your queries will hit either hotdb or colddb
See How to Load Test MongoDB with JMeter article for detailed information
How about reading the value from a file in a beanshell/javascript sampler each iteration and storing in a variable, then editing/saving the file when you want to switch? It's ugly but it would work.

How can I verify that the text corrosponding to configured text data is present in a table using Selenium IDE

I am using Selenium IDE to automate the testing of GUI of my company.At a point my manual test case say that
"Verify that the view screen display the data corresponding to configured data.".
After I insert any node the node get inserted in the table which contain node name and its inside values in front of it. Now I have to verify that whether this node has been inserted or not using Selenium IDE
I tried verifytextpresent command but it is not working .
The problem I am facing is that there is no ID of the table and its inside rows and columns.
What commands should I use to solve this problem.
You might want to consider using javascript -
If there's a class name associated with it, use getElementsByClass
Else, you can always use getElementsbyTagName
Cheers

How to set "skip" on MongoDB text search?

I start using the new MongoDB text search but then I realized it only supports "limit" and there's no "skip".
Is there anyway to get a "skip" behavior?
I think as of V2.4.0 you will need to implement this in your application code rather than trying to get Mongo DB to do this as part of a query request. My understanding is that the text search does not return a cursor.
Check the Jira for this issue, https://jira.mongodb.org/browse/SERVER-9063
One solution although not very efficient is to increase the limit size for each new page and then change where you start reading from accordingly.
basic idea below.
request 1
query.limit(20)
request 2
query.limit(40)
start reading from the last position +1
Not very elegant or efficient I'm afraid