improves sorting on ledger.
This commit is contained in:
@@ -630,7 +630,7 @@
|
|||||||
(conj {:sort-key "default" :asc (if (contains? args :default-asc?)
|
(conj {:sort-key "default" :asc (if (contains? args :default-asc?)
|
||||||
(:default-asc? args)
|
(:default-asc? args)
|
||||||
true)})
|
true)})
|
||||||
(conj {:sort-key "e" :asc true}))
|
(conj {:sort-key "e" :asc false}))
|
||||||
length (count sort-bys)
|
length (count sort-bys)
|
||||||
comparator (fn [xs ys]
|
comparator (fn [xs ys]
|
||||||
(reduce
|
(reduce
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
[auto-ap.datomic
|
[auto-ap.datomic
|
||||||
:refer [add-sorter-fields
|
:refer [add-sorter-fields
|
||||||
apply-pagination
|
apply-pagination
|
||||||
apply-sort-3
|
apply-sort-4
|
||||||
conn
|
conn
|
||||||
merge-query
|
merge-query
|
||||||
observable-query
|
observable-query
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
true
|
true
|
||||||
(merge-query {:query {:find ['?sort-default '?e]}})))]
|
(merge-query {:query {:find ['?sort-default '?e]}})))]
|
||||||
(->> (observable-query query)
|
(->> (observable-query query)
|
||||||
(apply-sort-3 (update args :sort conj {:sort-key "default-2" :asc true}))
|
(apply-sort-4 (update args :sort conj {:sort-key "default-2" :asc true}))
|
||||||
(apply-pagination args))))
|
(apply-pagination args))))
|
||||||
|
|
||||||
(defn graphql-results [ids db _]
|
(defn graphql-results [ids db _]
|
||||||
|
|||||||
91
terraform/solr_ec2.tf
Normal file
91
terraform/solr_ec2.tf
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
resource "aws_instance" "solr_ec2" {
|
||||||
|
ami = data.aws_ami.amazon_linux_2023.id
|
||||||
|
instance_type = "m7g.large"
|
||||||
|
key_name = "http-proxy"
|
||||||
|
|
||||||
|
vpc_security_group_ids = [ "sg-004e5855310c453a3", "sg-02d167406b1082698", "sg-08cd873bd29a2b3c9"]
|
||||||
|
subnet_id = "subnet-89bab8d4"
|
||||||
|
|
||||||
|
root_block_device {
|
||||||
|
volume_size = 30 # The size of the EBS volume in GB.
|
||||||
|
}
|
||||||
|
|
||||||
|
tags = {
|
||||||
|
Name = "solr_ec2_${var.stage}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data "aws_ami" "amazon_linux_2023" {
|
||||||
|
most_recent = true
|
||||||
|
|
||||||
|
filter {
|
||||||
|
name = "name"
|
||||||
|
values = ["al2023-ami-*"]
|
||||||
|
}
|
||||||
|
|
||||||
|
filter {
|
||||||
|
name = "virtualization-type"
|
||||||
|
values = ["hvm"]
|
||||||
|
}
|
||||||
|
filter {
|
||||||
|
name="architecture"
|
||||||
|
values=["arm64"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_ebs_volume" "solr_ec2_storage" {
|
||||||
|
availability_zone = aws_instance.solr_ec2.availability_zone
|
||||||
|
size = 30 # Size of the EBS volume in GB.
|
||||||
|
|
||||||
|
tags = {
|
||||||
|
Name = "solr_storage_${var.stage}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_volume_attachment" "attach_solr_storage" {
|
||||||
|
device_name = "/dev/xvdf" # Choose a suitable device name based on your needs.
|
||||||
|
instance_id = aws_instance.solr_ec2.id
|
||||||
|
volume_id = aws_ebs_volume.solr_ec2_storage.id
|
||||||
|
|
||||||
|
#wait_for detachment_timeout = "30m"
|
||||||
|
}
|
||||||
|
|
||||||
|
# You may need to add additional resources such as IAM roles, security groups configuration, etc.,
|
||||||
|
# depending on what services or actions your Solr needs access to.
|
||||||
|
|
||||||
|
output "ec2_public_ip" {
|
||||||
|
value = aws_instance.solr_ec2.public_ip
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
resource "aws_service_discovery_service" "solr_ec2" {
|
||||||
|
name = "solr-ec2-${var.stage}"
|
||||||
|
|
||||||
|
dns_config {
|
||||||
|
namespace_id = var.local_namespace
|
||||||
|
dns_records {
|
||||||
|
ttl = 60
|
||||||
|
type = "A"
|
||||||
|
}
|
||||||
|
|
||||||
|
routing_policy = "MULTIVALUE"
|
||||||
|
}
|
||||||
|
|
||||||
|
health_check_custom_config {
|
||||||
|
failure_threshold = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_service_discovery_instance" "solr_instance" {
|
||||||
|
service_id = aws_service_discovery_service.solr_ec2.id
|
||||||
|
instance_id = "solr-ec2"
|
||||||
|
|
||||||
|
attributes = {
|
||||||
|
"AWS_INSTANCE_IPV4" = aws_instance.solr_ec2.private_ip
|
||||||
|
}
|
||||||
|
|
||||||
|
depends_on = [
|
||||||
|
aws_service_discovery_service.solr_ec2,
|
||||||
|
aws_instance.solr_ec2,
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user